dnt
is-bun
Our great sponsors
dnt | is-bun | |
---|---|---|
10 | 1 | |
1,164 | 24 | |
2.6% | - | |
7.6 | 5.5 | |
2 days ago | 7 months ago | |
Rust | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
dnt
-
Creating an NPM Package in 2024 (Deno, dnt)
We are going to use dnt - Deno to Node Transform tool to build the npm package.
- Ryan Dahl: "our goal is to have Deno be the fastest JS runtime"
-
Build package for NPM & Deno
As already mentioned dnt might help you if you are willing to have deno as your primary development environment. I work in a project like this and the deno tooling is great. I don't even need a package.json since dnt will generate it for me.
-
How to build, test, and publish a TypeScript npm package in 2022
Build it in Deno and then use dnt to create an npm package. That way you support both JS runtimes: https://github.com/denoland/dnt
-
Write once, run anywhere with Deno and Dnt
Specifically, make my codebase be for Deno, use Deno built-in formatter, linter and testing, and use dnt (Deno to Node Transform) to generate an npm package containing ESM code and to test generated code. For testing in the browser, deploy the test content linked to the generated ESM code to Github Pages and use playwright/test. For Cloudflare Workers, use wrangler to set up a worker locally for testing. A schematic diagram is shown below.
- Fresh is a new full stack web framework for Deno
-
tsx: Node.js enhanced with esbuild to run TypeScript & ESM
I ended up building the library with Deno and compiling to Node.js CJS and ESM using https://github.com/denoland/dnt
-
Deno 1.20
Yes, TS code is compiled to run in browsers. You can compile and bundle using `deno bundle` if your project is developed in Deno. Since I'm using Deno for library development, I use the `dnt`[1] tool to compile them into ESM modules later consumed by esbuild in my Node-based projects/toolchains.
[1] https://github.com/denoland/dnt
-
How to compule/bundle code for nodejs?
Maybe this could help? https://github.com/denoland/dnt
is-bun
-
Creating an NPM Package in 2024 (Deno, dnt)
So in the GH repo here's the content of main.ts:
What are some alternatives?
klaro-js - Klaro Privacy Manager. An open-source, privacy-friendly & compliant consent manager for your website.
is-not-bun - Return true if you are running not in Bun.
ts-runtime-comparison - Comparison of Node.js TypeScript runtimes
SimpleWebAuthn - WebAuthn, Simplified. A collection of TypeScript-first libraries for simpler WebAuthn integration. Supports modern browsers, Node, Deno, and more.
tsx - ⚡️ TypeScript Execute: Node.js enhanced to run TypeScript & ESM
upstash-redis - HTTP based Redis Client for Serverless and Edge Functions
undici - An HTTP/1.1 client, written from scratch for Node.js
publint - Lint packaging errors
deno - A modern runtime for JavaScript and TypeScript.
oak - A middleware framework for handling HTTP with Deno, Node, Bun and Cloudflare Workers 🐿️ 🦕
SvelteKit - web development, streamlined
bun - Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one