TS-ESNode
esbuild-runner
Our great sponsors
TS-ESNode | esbuild-runner | |
---|---|---|
2 | 2 | |
37 | 701 | |
- | - | |
6.0 | 0.0 | |
5 months ago | 2 days ago | |
TypeScript | TypeScript | |
MIT License | Apache License 2.0 |
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.
TS-ESNode
-
Hello Yarn 2, Goodbye node_modules
CommonJS is a great module system if you're using JS for scripting Unix (which it excels at). Is there a good reason to use ESM though? I've been half-joking that it's the "extinguish" phase of Microsoft's EEE strategy for JS.
I know one legitimate reason is "tree shaking" (source-level LTO when bundling modules). Dumber, static import/export statements probably simplify that in some way. However ESM destroys the isomorphism between JS modules and the filesystem.
One change that ES modules introduced, I think, for no other reason than to be backwards incompatible, is changing the behavior of the default export (`export default foo` transpiles down to `module.exports.default = foo` instead of `module.exports = foo`).
Other "ohai guys this is the new normal now" kinds of changes are making the dynamic imports async-only (after not supporting them for a while) as well as changing the behavior of module resolution.
And the cherry on top is called TS-ESNode: https://github.com/K-FOSS/TS-ESNode because TypeScript modules and ESM are the same thing yet you need to somehow find this third-party shim which is required for them to work together at all. It's enabled by wrapping the interpreter, just like Yarn2's new dependency resolution.
- easy way to reduce RAM consumption when using ts-node
esbuild-runner
-
Testing in typescript.
You can then use esbuild-runner to allow you to run tests written in TS. This will also work for any other test runner (mocha, tape, uvu, etc). Jest requires a bit more fiddling, as per usual. An alternative is running tests via TS-node, but it's little a bit slower.
-
n00b question
via ESbuild https://github.com/folke/esbuild-runner
What are some alternatives?
ts-node - TypeScript execution and REPL for node.js
esno - Alias to `tsx`
mocha-esbuild - Run tests with mocha compiled by esbuild
volta - Volta: JS Toolchains as Code. ⚡
tsx - ⚡️ TypeScript Execute: Node.js enhanced to run TypeScript & ESM
esbuild-node-tsc - Build your Typescript Node.js projects using blazing fast esbuild
estrella - Lightweight and versatile build tool based on the esbuild compiler
bundlejs - An online tool to quickly bundle & minify your projects, while viewing the compressed bundle size, all running locally on your browser. A quick and easy way to bundle, minify, and compress (gzip and brotli) your ts, js, jsx and npm projects all online, with the bundle file size.
codemirror - A minor test of Codemirror
tsup - The simplest and fastest way to bundle your TypeScript libraries.