1.1.0 • Published 4 years ago

read-babelrc-up v1.1.0

Weekly downloads
23,623
License
MIT
Repository
github
Last release
4 years ago

read-babelrc-up

Build Status styled with prettier All Contributors

Read the closet Babel configuration file or babel in package.json.

Install

$ npm install --save read-babelrc-up

Usage

const readBabelrcUp = require('read-babelrc-up')

readBabelrcUp().then(result => {
  console.log(result)
  /*
  {
    babel:
     { presets: [ 'es2015', 'react' ],
      plugins: [ 'transform-class-properties' ] },
    path: '/Users/akameco/src/my-babel-app/.babelrc'
  }
  */
})

API

readBabelrcUp(options)

Returns a Promise for the result object.

readBabelrcUp.sync(options)

Return the result object.

options

cwd

Type: string Default: .

Directory to start looking for .babelrc file.

Related

  • find-up - Find a file by walking up parent directories

Contributors

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © akameco