Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 2 months ago
JSON representation

Read the closet .babelrc file

Awesome Lists containing this project

README

        

# read-babelrc-up

[![Build Status](https://travis-ci.org/akameco/read-babelrc-up.svg?branch=master)](https://travis-ci.org/akameco/read-babelrc-up)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#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)