npm

Need private packages and team management tools?Check out npm Orgs. »

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
Report a vulnerability