Registry / toranb-es6-module-transpiler

toranb-es6-module-transpiler

JSON →
library0.0.2jsnpmunverified

A temporary fork of the es6-module-transpiler incorporating PR #100. The ES6 Module Transpiler (original by Square) is an experimental compiler that allows writing JavaScript using a subset of the ES6 module syntax and compiling to AMD or CommonJS modules. This fork version 0.0.2 was published on npm as a stopgap fix. The project is now obsolete as ES6 module syntax has stabilized and native support exists. Key differentiator: this fork includes a specific patch not yet merged upstream at the time.

npm install toranb-es6-module-transpiler
INSTALL
IMPORT
SIG · TORANB-ES6-MODULE-
T
toranb-es6-module-transpiler
javascriptv0.0.2
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
var Compiler = require('es6-module-transpiler').Compiler;
import { Compiler } from 'es6-module-transpiler';
This package is CommonJS only; no ESM support.
Container
var Container = require('es6-module-transpiler').Container;
import Container from 'es6-module-transpiler';
Container is a named export, not default.
Formatters
var formatters = require('es6-module-transpiler').formatters;
const { formatters } = require('es6-module-transpiler');
formatters is a property on the exports object, not a named export in older versions.

Demonstrates using the Compiler class to transpile ES6 module syntax to AMD output.

var Compiler = require('es6-module-transpiler').Compiler; var inputString = 'import { foo } from "bar"; export var baz = foo;'; var compiler = new Compiler(inputString, 'myModule'); var output = compiler.toAMD(); console.log(output);
Debug
Known issues
deprecatedThis package is a temporary fork and is no longer maintained. Use native ES modules or modern bundlers.
fix
Migrate to ES6 modules natively or use a stable transpiler like Babel.
affects: *
gotchaThe package version 0.0.2 is experimental and may not reflect final ES6 spec syntax.
fix
Do not rely on this for production code; only for experimentation.
affects: *
gotchaThis fork includes a specific PR #100 fix; check the upstream repository for merged changes.
fix
Use the official package if the fix has been merged upstream.
affects: 0.0.2
Errors
Common errors & fixes
Cannot find module 'es6-module-transpiler'
The package name on npm is 'toranb-es6-module-transpiler', not 'es6-module-transpiler'.
fix
npm install toranb-es6-module-transpiler and require('toranb-es6-module-transpiler')
Module not found: Error: Can't resolve 'es6-module-transpiler'
Using a bundler like webpack with an incorrect import path.
fix
Use require('toranb-es6-module-transpiler') or configure webpack resolve.alias.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
es6-module-transpilerrequiredthis is a fork that includes a specific PR on top of the upstream package
Agent activity
4 hits · last 30 days
node
4
Resources
toranb-es6-module-transpiler — npm install toranb-es6-module-transpiler · libregistry