cjstoesm
pseudo-shuffle
cjstoesm | pseudo-shuffle | |
---|---|---|
1 | 1 | |
374 | 12 | |
- | - | |
0.0 | 4.1 | |
5 months ago | 11 months ago | |
TypeScript | 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.
cjstoesm
-
How to use ESM on the web and in Node.js
There are tools to help make migrating code from CommonJS to ES Modules easy. One of the most popular tools is cjstoesm, a command line tool that automatically transforms CommonJS code in Node to its ESM equivalent. Almost all CommonJS code is transformed. However, there are some things that are not transformed. The most notable is the __dirname. __dirname is not part of Node.js, but it is one thing that Node does not suppport in "ESM mode". Luckily, there are replacements. A simple way to polyfill __dirname is to do this:
pseudo-shuffle
-
Can you quickly shuffle the index of a trillion documents without conflict?
Rocket*: It's no big deal, just use* psuedo-shuffle.js in the middle, it'll take 4 lines, Don't say you can't make it to the gym tonight bro.
What are some alternatives?
pkgroll - 📦 Zero-config package bundler for Node.js + TypeScript
SimpleWebAuthn - WebAuthn, Simplified. A collection of TypeScript-first libraries for simpler WebAuthn integration. Supports modern browsers, Node, Deno, and more.
ts-c-compiler - ⚙️ Multipass C Compiler, Assembler and X86 emulator written in TypeScript
ctix - CLI to generate barrel file for webpack, rollup entrypoint
node-win32-api - win32 api
webpack - A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.
tsx - ⚡️ TypeScript Execute: Node.js enhanced to run TypeScript & ESM
vite - Next generation frontend tooling. It's fast!
run - Safely execute untrusted code with ESM syntax support, dynamic injection of ESM modules from URL or plain JS code, and granular access control based on whitelisting for each JS object.
cynic - simple async run-anywhere js testing framework
Fleet-of-the-Faithful-Knights - Monorepo for the Fleet of the Faithful Knights