Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Deno
  3. dnt

dnt

MITRust0.42.3

A build tool that transforms Deno modules into npm packages for Node.js, handling module specifiers, shims, and testing.

GitHubGitHub
1.3k stars48 forks0 contributors

What is dnt?

dnt (Deno to Node Transform) is a build tool that converts Deno modules into npm packages compatible with Node.js. It rewrites module specifiers, injects shims for Deno APIs, generates ESM and CommonJS outputs, and runs tests in Node.js, solving the problem of publishing Deno code to the npm registry.

Target Audience

Deno developers who want to distribute their libraries as npm packages for use in Node.js projects, or teams maintaining dual Deno/Node.js codebases.

Value Proposition

Developers choose dnt because it automates the entire Deno-to-Node conversion process with robust shimming, type checking, and testing, reducing manual effort and ensuring compatibility. Its flexibility in handling custom shims, specifier mappings, and multiple entry points makes it the most comprehensive tool for this niche.

Overview

Deno to npm package build tool.

Use Cases

Best For

  • Publishing Deno libraries to npm for Node.js users
  • Maintaining a single codebase that targets both Deno and Node.js
  • Automating CI/CD pipelines for Deno-to-npm package builds
  • Converting Deno CLI tools into npm-executable binaries
  • Handling Deno-specific APIs like the Deno namespace in Node.js
  • Generating dual ESM and CommonJS outputs from Deno modules

Not Ideal For

  • Projects that don't use Deno at all and are purely Node.js-based
  • Teams seeking a zero-configuration, drop-in build tool without any setup
  • Codebases heavily reliant on top-level await that must output CommonJS
  • Targeting Node.js v14 or older where shim compatibility is limited and requires workarounds

Pros & Cons

Pros

Automated Module Rewriting

Transforms Deno import URLs to Node.js-compatible specifiers, including esm.sh and remote modules, handling a complex manual process automatically.

Comprehensive API Shimming

Injects shims for the Deno namespace and other globals using packages like @deno/shim-deno, enabling Deno code to run in Node.js with minimal code changes.

Dual Module Output

Generates both ESM and CommonJS/UMD packages alongside TypeScript declaration files by default, ensuring broad compatibility across Node.js environments.

Integrated Testing Pipeline

Runs Deno.test suites in Node.js after transformation, verifying functionality and catching issues before publishing, as shown in the build logs.

Cons

Complex Configuration Overhead

Setting up custom shims, specifier mappings, and handling edge cases like top-level await requires manual intervention and deep familiarity with the tool's options.

Limited Old Node Support

The README admits that targeting Node v14 and below is problematic, with certain shims not working reliably and necessitating workarounds like Deno.test-only shimming.

Build Time and Shim Overhead

The transformation process adds build time, and injected shims can increase package size and runtime overhead, which may impact performance-sensitive applications.

Frequently Asked Questions

Quick Stats

Stars1,325
Forks48
Contributors0
Open Issues105
Last commit11 months ago
CreatedSince 2021

Tags

#npm-package#package-publishing#deno#cli-tool#typescript#node-js#shims#build-tool

Built With

D
Deno
T
TypeScript

Included in

Deno4.4k
Auto-fetched 1 day ago

Related Projects

vscode-denovscode-deno

Visual Studio Code plugin for Deno

Stars1,548
Forks163
Last commit2 days ago
denondenon

👀 Monitor any changes in your Deno application and automatically restart.

Stars1,109
Forks44
Last commit2 years ago
deno_dockerdeno_docker

Latest dockerfiles and images for Deno - alpine, centos, debian, ubuntu

Stars1,014
Forks114
Last commit3 days ago
denoifydenoify

🦕For NPM module authors that would like to support Deno but do not want to write and maintain a port.

Stars949
Forks23
Last commit8 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub