Have ideas to improve npm?Join in the discussion! »

    esfuture

    1.0.1 • Public • Published

    esnext

    Bring your JavaScript into the future.

    Installation

    $ npm install -g esnext
    

    Usage

    After installing, run esnext -h for comprehensive usage instructions.

    Features

    Modules

    Translate CommonJS modules into ES6 modules:

    var readFile = require('fs').readFile;
    const MagicString = require('magic-string');
    let { ok, strictEqual: eq } = require('assert');
     
    exports.doSomething = function() {
      ok(1);
    };
     
    // ↑ becomes ↓
     
    import { readFile } from 'fs';
    import MagicString from 'magic-string';
    import { ok, strictEqual as eq } from 'assert';
     
    export function doSomething() {
      ok(1);
    }

    Functions

    Translate some regular functions to arrow functions:

    list.map(function(item) { return item.name; });
     
    // ↑ becomes ↓
     
    list.map(item => item.name);

    Keywords

    Install

    npm i esfuture

    DownloadsWeekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • avatar