Registry / serialization / es6-node-module

es6-node-module

JSON →
library0.1.0jsnpmunverified

An early experimental library for describing Node.js modules using ES6 module notation and transpiling them to CommonJS. Version 0.1.0 is the initial release. It resolves local and npm imports. This project is an early prototype from 2014 and has not seen updates; it is effectively abandoned. Key differentiator: allows authoring ES6 modules and transpiles to ES5 CommonJS, but predates modern standards like Babel.

npm install es6-node-module
INSTALL
IMPORT
SIG · ES6-NODE-MODULE
E
es6-node-module
serializationjavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NodePackage
import { NodePackage } from 'es6-node-module'
ESM import works if using modern Node (>=13) or bundler; original usage was CommonJS require()
nodePackage
const { nodePackage: NodePackage } = require('es6-node-module');
const NodePackage = require('es6-node-module').nodePackage;
Original documentation used .nodePackage on the require result; same as destructuring but valid
getDependencies
import { getDependencies } from 'es6-node-module'
const getDependencies = require('es6-node-module').getDependencies;
Can be imported as named export or via destructuring require

Shows how to load a NodePackage, retrieve a module, transpile to CJS, and get recursive dependencies.

const { NodePackage, getDependencies } = require('es6-node-module'); const nodePackage = new NodePackage('/some/node/path'); const utilModule = nodePackage.getModule('./lib/util'); console.log(utilModule.fullPath); console.log(utilModule.src); console.log(utilModule.toCJSString()); const deps = getDependencies(true, false, utilModule); deps.forEach(dep => console.log(dep.fullPath));
Debug
Known issues
deprecatedPackage is no longer maintained and does not support modern ES6/ES2015+ syntax.
fix
Use modern tools like Babel, SWC, or esbuild instead.
affects: <=0.1.0
gotchaThe package is not compatible with Node.js >=14; engine requirement is >=0.10.0 but may fail on newer Node versions.
fix
Use Node.js 0.10.x – 0.12.x, or avoid this package.
affects: ==0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'es6-node-module'
Package is very old and may need npm install with --legacy-peer-deps
fix
npm install es6-node-module --save --legacy-peer-deps
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
es6-node-module — npm install es6-node-module · libregistry