{"id":25249,"library":"es6-module-transpiler-rhengles","title":"ES6 Module Transpiler (rhengles fork)","description":"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.","status":"deprecated","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/rhengles/es6-module-transpiler","tags":["javascript","es6","module","transpile","amd","commonjs"],"install":[{"cmd":"npm install es6-module-transpiler-rhengles","lang":"bash","label":"npm"},{"cmd":"yarn add es6-module-transpiler-rhengles","lang":"bash","label":"yarn"},{"cmd":"pnpm add es6-module-transpiler-rhengles","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The library provides a CommonJS default export; using named import may fail in some bundlers.","wrong":"const Compiler = require('es6-module-transpiler').Compiler","symbol":"Compiler","correct":"import { Compiler } from 'es6-module-transpiler'"},{"note":"In ESM environments, default import works but the transpiler expects CommonJS.","wrong":"const transpiler = require('es6-module-transpiler')","symbol":"default (module)","correct":"import transpiler from 'es6-module-transpiler'"},{"note":"Formatter may not be exported in all versions.","wrong":"var Formatter = require('es6-module-transpiler').Formatter","symbol":"Formatter","correct":"import { Formatter } from 'es6-module-transpiler'"}],"quickstart":{"code":"const { Compiler } = require('es6-module-transpiler');\n\nconst code = `\n  export function square(x) {\n    return x * x;\n  }\n`;\n\nconst compiler = new Compiler(code, 'myModule');\nconst amdOutput = compiler.toAMD();\nconsole.log(amdOutput);\n// Outputs AMD define(...)\n\nconst cjsOutput = compiler.toCJS();\nconsole.log(cjsOutput);\n// Outputs CommonJS exports...\n","lang":"javascript","description":"Shows how to use the Compiler class to transpile ES6 module syntax to AMD and CommonJS."},"warnings":[{"fix":"Migrate to Babel or TypeScript for modern module transpilation.","message":"The ES6 module syntax supported by this transpiler is outdated and not compliant with the finalized ES6 specification.","severity":"deprecated","affected_versions":">=0.1.0 <=0.3.0"},{"fix":"Use `npx es6-module-transpiler` or install globally via `npm install -g es6-module-transpiler` if available, but prefer library usage.","message":"The `compile-modules` CLI command may not be installed correctly if the package is not installed globally with the exact URL from Git.","severity":"gotcha","affected_versions":">=0.1.0 <0.3.0"},{"fix":"Write code using only supported syntax: export/import declarations, no destructuring, no default exports for modules.","message":"The transpiler does not support destructuring or other modern JavaScript features—only a strict subset of ES6 module syntax.","severity":"gotcha","affected_versions":">=0.1.0 <=0.3.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `npm install es6-module-transpiler` and ensure the module is in node_modules.","cause":"The package is not installed or the import path is incorrect.","error":"Cannot find module 'es6-module-transpiler'"},{"fix":"Use `const { Compiler } = require('es6-module-transpiler');`","cause":"Using `require('es6-module-transpiler')` returns an object with `Compiler` property, but if you import the default incorrectly.","error":"Compiler is not a constructor"},{"fix":"Run the code through `compile-modules` or use the Compiler class programmatically.","cause":"The JavaScript file uses ES6 module syntax but is not processed by the transpiler.","error":"Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}