compile-es6

2.0.1 • Public • Published

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']

Dependencies (6)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i compile-es6

    Weekly Downloads

    197

    Version

    2.0.1

    License

    ISC

    Last publish

    Collaborators

    • antfoot