Node.js standard library converted to runtime-agnostic ES modules.
npm install nstdlib-nightlyNode.js standard library converted to runtime-agnostic ES modules.
Commits to the main branch are automatically built and published to the npm nstdlib-nightly package.
You can browse build output with unpkg.
This project is pretty much in the POC stage.
- [x] Lib is copied with basic ESM to CJS syntax upgrade
- [x] Some cjs-es edge cases with specific require fixed
- [x] Primordials are inlined
- [x] ESM imports are validated and canonically rewritten to nstdlib/\* subpaths
- [x] Auto stub non js internal and bindings from actual runtime
- [x] Shim support (for initial step)
- [x] Hoist nested requires
- [x] Strip debug bits
- [ ] Basic working runtime
- [ ] Many of the shims could be simple patch for name export, etc.
- [ ] Run tests in an agnostic runtime (workerd, perhaps?)
See contribution guide for local development.
This project is available under the MIT license.
Bundled code and external dependencies are subject to the Node.js license.