Using npm/Node.js code

While Deno is pretty powerful itself, there is a large eco-system of code in the npm registry, and many people will want to re-leverage tools, code and libraries that are built for Node.js . In this chapter we will explore how to use it.

⚠️ Starting with v1.15 Deno provides a compatibility mode, that allows to emulate Node.js environment and consume code authored for Node.js directly. See Node.js compatibility mode chapter for details.

The good news, is that in many cases, it just works.

There are some foundational things to understand about differences between Node.js and Deno that can help in understanding what challenges might be faced:

In order to help mitigate these differences, we will further explore in this chapter:

That being said, there are some differences that cannot be overcome: