cjs2es6export
convert CommonJS module assignments to ES6 module export statements
Last updated 5 years ago by deathcap .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install cjs2es6export 
SYNC missed versions from official npm registry.

cjs2es6export

Convert a subset of CommonJS/NodeJS module.exports assignments to ECMAScript 6 module export declarations.

Usage:

var cjs2es6export = require('cjs2es6export');

var src = "module.exports = function() { return 42; };"
var newSrc = cjs2es6export(src); // "export default function() {\n return 42;\n};;"

Currently only direct assignment to module.exports (translated to default export) is supported.

See also cjs2es6import

License

MIT

Current Tags

  • 0.2.1                                ...           latest (5 years ago)

2 Versions

  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (5)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2017 © taobao.org |