Because Deno is incompatible with Node.js, libraries need two variants in order to target both runtimes.
Deno provides the superior developer experience: it requires no explicit transpilation step, and ships with zero-conf tooling that works well together.
We prefer to write code targeting Deno, and use tools to create the Node.js variant, rather than vice-versa.
We set out to write these tools.
Enables using some Deno APIs on Node.js, by providing a shim for the Deno
namespace.
End-to-end tested tool that accepts a tsconfig.json
describing a Deno project and:
- Makes relative imports Node-friendly,
- Optionally shims Deno globals not available in Node.js,
- Allows to provide Node.js variant for some files if all else fails,
- Outputs
.js
,.d.ts
and.d.ts.map
, just like TypeScript.