Registry / serialization / es6-module-transpiler-rhengles

es6-module-transpiler-rhengles

JSON →
library0.3.0jsnpmunverified

Experimental compiler that transforms a subset of ES6 module syntax into AMD or CommonJS modules. Version 0.3.0, unmaintained since 2015. Key differentiator: early ES6 module syntax experimentation, but the syntax it supports differs from the finalized ES6 spec. No longer recommended for new projects; use Babel or TypeScript instead.

npm install es6-module-transpiler-rhengles
INSTALL
IMPORT
SIG · ES6-MODULE-TRANSPI
E
es6-module-transpiler-rhengles
serializationjavascriptv0.3.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.

Compiler
import { Compiler } from 'es6-module-transpiler'
const Compiler = require('es6-module-transpiler').Compiler
The library provides a CommonJS default export; using named import may fail in some bundlers.
default (module)
import transpiler from 'es6-module-transpiler'
const transpiler = require('es6-module-transpiler')
In ESM environments, default import works but the transpiler expects CommonJS.
Formatter
import { Formatter } from 'es6-module-transpiler'
var Formatter = require('es6-module-transpiler').Formatter
Formatter may not be exported in all versions.

Shows how to use the Compiler class to transpile ES6 module syntax to AMD and CommonJS.

const { Compiler } = require('es6-module-transpiler'); const code = ` export function square(x) { return x * x; } `; const compiler = new Compiler(code, 'myModule'); const amdOutput = compiler.toAMD(); console.log(amdOutput); // Outputs AMD define(...) const cjsOutput = compiler.toCJS(); console.log(cjsOutput); // Outputs CommonJS exports...
Debug
Known issues
deprecatedThe ES6 module syntax supported by this transpiler is outdated and not compliant with the finalized ES6 specification.
fix
Migrate to Babel or TypeScript for modern module transpilation.
affects: >=0.1.0 <=0.3.0
gotchaThe `compile-modules` CLI command may not be installed correctly if the package is not installed globally with the exact URL from Git.
fix
Use `npx es6-module-transpiler` or install globally via `npm install -g es6-module-transpiler` if available, but prefer library usage.
affects: >=0.1.0 <0.3.0
gotchaThe transpiler does not support destructuring or other modern JavaScript features—only a strict subset of ES6 module syntax.
fix
Write code using only supported syntax: export/import declarations, no destructuring, no default exports for modules.
affects: >=0.1.0 <=0.3.0
Errors
Common errors & fixes
Cannot find module 'es6-module-transpiler'
The package is not installed or the import path is incorrect.
fix
Run `npm install es6-module-transpiler` and ensure the module is in node_modules.
Compiler is not a constructor
Using `require('es6-module-transpiler')` returns an object with `Compiler` property, but if you import the default incorrectly.
fix
Use `const { Compiler } = require('es6-module-transpiler');`
Unexpected token 'export'
The JavaScript file uses ES6 module syntax but is not processed by the transpiler.
fix
Run the code through `compile-modules` or use the Compiler class programmatically.
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

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