Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    cjs2es6exportpublic

    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

    Keywords

    none

    install

    npm i cjs2es6export

    Downloadsweekly downloads

    6

    version

    0.2.1

    license

    MIT

    homepage

    github.com

    last publish

    collaborators

    • avatar