https://github.com/akameco/read-babelrc-up
Read the closet .babelrc file
https://github.com/akameco/read-babelrc-up
babel babelrc find-up json
Last synced: 10 months ago
JSON representation
Read the closet .babelrc file
- Host: GitHub
- URL: https://github.com/akameco/read-babelrc-up
- Owner: akameco
- License: mit
- Created: 2017-04-21T00:23:53.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T16:15:02.000Z (over 3 years ago)
- Last Synced: 2025-08-09T14:51:43.557Z (11 months ago)
- Topics: babel, babelrc, find-up, json
- Language: JavaScript
- Homepage:
- Size: 1.19 MB
- Stars: 3
- Watchers: 1
- Forks: 3
- Open Issues: 14
-
Metadata Files:
- Readme: readme.md
- License: license
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# read-babelrc-up
[](https://travis-ci.org/akameco/read-babelrc-up)
[](https://github.com/prettier/prettier)
[](#contributors)
> Read the closet [Babel configuration file](https://babeljs.io/docs/en/config-files) or `babel` in package.json.
## Install
```
$ npm install --save read-babelrc-up
```
## Usage
```js
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](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories
## Contributors
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):

akameco
💻 📖 ⚠️ 🚇

Jiyoon Jang
💻 ⚠️
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
## License
MIT © [akameco](http://akameco.github.io)