Skip to main content
Deno 2 is finally here 🎉️
Learn more

deno2node

deno doc

Transpiles Deno projects into .js and .d.ts for Node.js.

Preparing your project

Rename deps.ts to deps.deno.ts, create corresponding deps.node.ts.

If you’re using some Deno globals not available in Node (Deno, fetch…), export their shims from shim.node.ts, and add the following to your tsconfig.json:

// tsconfig.json
{
  "deno2node": {
    "shim": "src/shim.node.ts"
  }
}

Usage from Node.js

$ npm install --save-dev deno2node
$ deno2node <tsConfigFilePath>

Usage from Deno

$ deno run --unstable --allow-read --allow-write https://raw.githubusercontent.com/wojpawlik/deno2node/v0.3.0/src/cli.ts <tsConfigFilePath>