compile-es6
compile es6 code in folders/files
Last updated 7 months ago by antfoot .
ISC · Repository · Bugs · Original npm · Tarball
$ cnpm install compile-es6 
SYNC missed versions from official npm registry.

Alert

Now we have a better npm package: compile-esx and compile-esx-sync

The compile-es6 will not be maintained...

What

compile-es6 can compile es6 code in src folder to es5 code in target folder.

Example

const compileEs6 = require('compile-es6');

compileEs6(path.join(__dirname, 'src'), path.join(__dirname, 'target'));

How

const compileEs6 = require('compile-es6');

compileEs6(srcFileOrFolderPath, targetFolderPath[, config]);
  • srcFileOrFolderPath

    • necessary: true
    • type: string
    • content: absolute file or folder path
  • targetFolderPath

    • necessary: true
    • type: string
    • content: absolute folder path
  • config

    • necessary: false

    • type: object

      • include

        Like webpack, compile-es6 will only compile files matching include.

        • necessary: false
        • type: regular expression
        • default: /\.js$/
      • exclude

        Like webpack, compile-es6 will not compile files matching exclude.

        • necessary: false
        • type: regular expression
        • default: null
      • presets

        for babel preset config.

        • necessary: false
        • type: array
        • default: ['es2015']
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |