Nullifying Precipitation Machine
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@buxlabs/before-all-to-es6

0.2.0 • Public • Published

before-all-to-es6

Convert specs with beforeAll to ES6

Installation

npm install -g @buxlabs/before-all-to-es6

Usage

Convert a single file with:

batoes6 app.js > app-es6.js

Convert multiple files in given dir with:

batoes6 --src=src --dest=build

Convert multiple files in given dir recursively with:

batoes6 --src=src --dest=build --glob=**/*.js

Convert multiple files and replace them with:

batoes6 --src=src --replace

Examples:

SPEC

describe('one dependency', function () {
 
    var Backbone;
 
    beforeAll(function (done) {
        require(['backbone'], function () {
           Backbone = arguments[0];
           done();
        });
    });
 
    it('should be defined', function () {
        expect(Backbone).toBeDefined();
    });
 
});

ES6

import Backbone from 'backbone';
 
describe('one dependency', function () {
 
    it('should be defined', function () {
        expect(Backbone).toBeDefined();
    });
 
});

There are more examples in the test/fixture directory

Options

 
  Usage: batoes6 [options]
 
  Options:
 
    -s, --src <dirname>     Directory of the source files
    -d, --dest <dirname>    Directory of the destination files
    -g, --glob [glob]       Glob pattern for the src to match for input files
    -r, --recursive         Set glob pattern to **/*.js with no hassle
    -b, --beautify          Beautify the output
    --quotes            Single, double or auto quotes in the output
    --replace           Replace the input files with results
 

Install

npm i @buxlabs/before-all-to-es6

DownloadsWeekly Downloads

0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • avatar
  • avatar