An ES6 and CommonJS cross-compatible transpiler that enables mixed usage of ES6 modules and CommonJS modules during migration. Version 2.0.1 is the latest stable release but appears to be in maintenance mode as the project has seen no recent updates and uses legacy dependencies like recast and esprima-fb. Unlike higher-level transpilers (e.g., Babel), this is a lower-level library that operates on recast ASTs, allowing flexibility in custom build pipelines but lacking file system resolution and custom formatters.
npm install es6-module-crosspilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
This shows how to transpile a simple ES6 import statement to CommonJS using recast, esprima-fb, and the crosspiler.
Use a more modern transpiler like Babel or TypeScript for ES6 module transpilation.
When cross-compiling, ensure that CommonJS modules do not export a .default property, as it will be overridden.
Migrate to a maintained transpiler such as Babel or esbuild.
Always provide dependency metadata to avoid incorrect transpilation.
Use a custom esprima that supports ES6 modules, e.g., 'esprima-fb', when calling recast.parse().
Use default import: import Module from 'es6-module-crosspiler'