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.

serialization
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.

ESM import works if using modern Node (>=13) or bundler; original usage was CommonJS require()

import { NodePackage } from 'es6-node-module'

Original documentation used .nodePackage on the require result; same as destructuring but valid

const { nodePackage: NodePackage } = require('es6-node-module');

Can be imported as named export or via destructuring require

import { getDependencies } from 'es6-node-module'

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 footguns
deprecatedPackage is no longer maintained and does not support modern ES6/ES2015+ syntax.
gotchaThe package is not compatible with Node.js >=14; engine requirement is >=0.10.0 but may fail on newer Node versions.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
10 hits · last 30 days
claudebot
4
gptbot
3
ahrefsbot
3
Resources