hpke-js
dnt
hpke-js | dnt | |
---|---|---|
1 | 10 | |
52 | 1,166 | |
- | 1.7% | |
9.1 | 7.6 | |
about 1 month ago | 9 days ago | |
TypeScript | Rust | |
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.
hpke-js
-
Write once, run anywhere with Deno and Dnt
import { build, emptyDir } from "dnt"; await emptyDir("./npm"); await build({ entryPoints: ["./mod.ts"], outDir: "./npm", typeCheck: true, test: true, declaration: true, scriptModule: "umd", importMap: "./import-map.json", compilerOptions: { lib: ["es2021", "dom"], }, shims: { deno: "dev", }, package: { name: "hpke-js", version: Deno.args[0], description: "A Hybrid Public Key Encryption (HPKE) module for web browsers, Node.js and Deno", repository: { type: "git", url: "git+https://github.com/dajiaji/hpke-js.git", }, homepage: "https://github.com/dajiaji/hpke-js#readme", license: "MIT", main: "./script/mod.js", types: "./types/mod.d.ts", exports: { ".": { "import": "./esm/mod.js", "require": "./script/mod.js", }, "./package.json": "./package.json", }, keywords: [ "hpke", // ...省略 ], engines: { "node": ">=16.0.0", }, author: "Ajitomi Daisuke", bugs: { url: "https://github.com/dajiaji/hpke-js/issues", }, }, }); // post build steps Deno.copyFileSync("LICENSE", "npm/LICENSE"); Deno.copyFileSync("README.md", "npm/README.md");
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
What are some alternatives?
isomorphic-webcrypto - :game_die: webcrypto library for Node, React Native and IE11+
klaro-js - Klaro Privacy Manager. An open-source, privacy-friendly & compliant consent manager for your website.
5edm - end-to-end encrypted messaging on deno
ts-runtime-comparison - Comparison of Node.js TypeScript runtimes
esm.sh - A fast, smart, & global CDN for modern(es2015+) web development.
tsx - ⚡️ TypeScript Execute: Node.js enhanced to run TypeScript & ESM
undici - An HTTP/1.1 client, written from scratch for Node.js
is-bun - Return true if you are running in Bun.
deno - A modern runtime for JavaScript and TypeScript.
SvelteKit - web development, streamlined
denoify - 🦕For NPM module authors that would like to support Deno but do not want to write and maintain a port.