JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q26063F
  • License BSD

An ES6 to ES5 transformer, optionally convert AMD module to YUI3 style

Package Exports

  • es6y

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (es6y) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ES6Y

An ES6 to ES5 transformer, optionally convert AMD module to YUI3 style using the Facebook's jstransform module.

The following program:

    define('yui-module-test', [ 'yui', 'node' ], function (Y, node) {
        console.log(Y.one('#node').setHTML([3, 1, 2].sort((a, b) => { return b - a; })));
    });

gets transformed into:

    YUI.add('yui-module-test', function (Y) {
        console.log(Y.one('#node').setHTML([3, 1, 2].sort(function(a, b)  { return b - a; })));
    }, '1.0.0', { requires: [ 'node' ] });

Run es6y --help to get started.

Running

    shell$ es6y --yui3 -- input.js
    # creates compiled/input.js
    shell$ es6y --yui3 <input.js
    # outputs the converted file on standard output
    shell$ es6y --outdir=/tmp/js --yui3 -- file1.js file2.js
    # creates /tmp/js/file1.js, /tmp/js/file2.js with the converted output