NPM compatibility

Edge Functions natively support NPM modules and Node built-in APIs.

Stage:
Beta
Available on self-hosted:
Yes

Supabase's NPM Compatibility feature for Edge Functions allows you to use NPM modules and Node.js built-in APIs directly in your Deno-based Edge Functions. This powerful capability bridges the gap between Deno and the vast Node.js ecosystem, giving you access to a wide range of libraries and familiar APIs.

Key benefits

  1. Extensive library access: Leverage the vast NPM ecosystem in your Edge Functions.
  2. Familiar Node.js APIs: Use built-in Node.js modules you're already familiar with.
  3. Code reusability: Easily port existing Node.js code to Supabase Edge Functions.
  4. Ecosystem compatibility: Integrate with services and tools designed for Node.js environments.
  5. Simplified development: Reduce the learning curve for developers coming from a Node.js background.
  6. Flexibility: Choose between Deno-native and Node-compatible libraries as needed.
  7. Future-proofing: Adapt existing codebases to edge computing without major rewrites.

NPM compatibility is particularly valuable for:

  • Projects migrating from Node.js-based serverless platforms to Supabase
  • Developers looking to leverage specific NPM packages in edge computing scenarios
  • Applications requiring Node.js-specific libraries not available in Deno
  • Teams with existing Node.js codebases wanting to adopt edge computing
  • Rapid prototyping using familiar Node.js modules and APIs
  • Any project aiming to balance the benefits of Deno with Node.js ecosystem access

By leveraging NPM Compatibility in Supabase Edge Functions, you can take advantage of the best of both worlds: the modern, secure runtime of Deno and the rich ecosystem of Node.js. This feature allows you to build powerful, efficient edge computing solutions while maintaining access to the tools and libraries you're familiar with, accelerating development and enabling more complex use cases at the edge.

Read Documentation
Share

Build in a weekend, scale to millions