惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
月光博客
月光博客
IT之家
IT之家
B
Blog RSS Feed
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - Franky
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
博客园_首页
B
Blog
V
V2EX
腾讯CDC
Vercel News
Vercel News
量子位
Microsoft Security Blog
Microsoft Security Blog

Netlify Changelog

Gemini 3.5 Flash now available in Agent Runners 4 Nuxt CVEs: what Netlify users need to know Gemini 3.5 Flash now available in AI Gateway Agent Runners workflow improvements Next.js & React security release (May 2026): what to know Block project transfers out of your team Gemini 3.1 Flash-Lite now available in AI Gateway OpenAI GPT-5.5 Instant now available in AI Gateway New `netlify logs` CLI command Deploy to Netlify with Stripe Projects Netlify Database is now generally available OpenAI GPT-5.5 and GPT-5.5 Pro in AI Gateway & Agent Runners Rename an agent run GPT Image 2 now available in AI Gateway New frontend-design skill for Agent Runners Claude Opus 4.7 now available in AI Gateway and Agent Runners Pricing updates for Credit-based plans New sorting and filter controls on the Members page Netlify Database GA coming soon, no new databases for now Deploy logs streaming is now faster Netlify CLI adds prompt-based creation and anonymous deploys Deploy from Codex with the Netlify Plugin Hydrogen with React Router 7 now supported on Netlify Monitor credit usage by day Invoices for Enterprise Available on the Billing Page AI app development on production infrastructure with Netlify Introducing Prompt Templates OpenAI GPT-5.4 Nano and GPT-5.4 Mini in AI Gateway Change your pricing plan Internal Builder Role & Project Access Controls
Support for npm modules in Edge Functions
Nahrin Jalal · 2023-10-18 · via Netlify Changelog

Two weeks ago, we announced a reimagined experience for Netlify Functions. It includes a brand new API based on standard Request/Response objects and the ability to configure routing within the function code.

If you’ve ever used Netlify Edge Functions, our other serverless compute product, you’re probably thinking that these features feel familiar. That’s because we took the things that developers love about Edge Functions and brought them to Functions, with the goal of creating a more unified experience across the two products.

We’re now approaching that goal from the other direction by taking one of the key features of the Functions offering and adding it to Edge Functions. Starting today, you can use npm modules in your edge functions and leverage more than two million packages in the ecosystem to build your applications.

Getting started

Before using a module, start by adding it to your project. For instance, running the following command installs lodash.

We’re using the npm client in this example, but you can replace that with your favorite package manager, like Yarn, pnpm or Bun.

Just like with Functions, our build system will automatically install your packages using the right package manager according to your project setup.

Using modules

To use a module, load it into your edge function using an import declaration and access it according to its documentation.

import type { Config, Context } from "@netlify/edge-functions"

import _ from "lodash"

const compiled = _.template("Hello, dear visitor from <%= country %>!")

export default async (req: Request, context: Context) => {

const text = compiled({ country: context.geo.country.name })

return new Response(text)

}

export const config: Config = {

path: "/hello",

}

In this example, we’re rendering a message from a template using the geolocation data as input. If you deploy this edge function and access it, you should see a personalized message based on the country you’re accessing from.

Importing modules using full URLs is still possible and you can combine them with npm imports in the same file.

We’d love to hear from you

We’re still hard at work to make this feature capable of handling all the different packages in the vast npm ecosystem with different module formats and characteristics. Still, we wanted to get this tool in the hands of our customers as early as possible, so we’re launching it as a beta feature that we’re hoping to improve in collaboration with you. If you use the Netlify CLI to develop or deploy your functions, make sure you update to version 16.9.2 or above.

We invite you to try it and let us know about your experience through our support portal or our community forum.