Upgrade Ava to v4
This commit is contained in:
parent
9a40cc5274
commit
ce89f1b611
1153 changed files with 27264 additions and 95308 deletions
45
node_modules/pkg-conf/readme.md
generated
vendored
45
node_modules/pkg-conf/readme.md
generated
vendored
|
|
@ -1,9 +1,8 @@
|
|||
# pkg-conf [](https://travis-ci.org/sindresorhus/pkg-conf)
|
||||
# pkg-conf
|
||||
|
||||
> Get namespaced config from the closest package.json
|
||||
|
||||
Having tool specific config in package.json reduces the amount of metafiles in your repo (there are usually a lot!) and makes the config obvious compared to hidden dotfiles like `.eslintrc`, which can end up causing confusion. [XO](https://github.com/xojs/xo), for example, uses the `xo` namespace in package.json, and [ESLint](http://eslint.org) uses `eslintConfig`. Many more tools supports this, like [AVA](https://ava.li), [Babel](https://babeljs.io), [nyc](https://github.com/istanbuljs/nyc), etc.
|
||||
|
||||
Having tool specific config in package.json reduces the amount of metafiles in your repo (there are usually a lot!) and makes the config obvious compared to hidden dotfiles like `.eslintrc`, which can end up causing confusion. [XO](https://github.com/xojs/xo), for example, uses the `xo` namespace in package.json, and [ESLint](http://eslint.org) uses `eslintConfig`. Many more tools supports this, like [AVA](https://avajs.dev), [Babel](https://babeljs.io), [nyc](https://github.com/istanbuljs/nyc), etc.
|
||||
|
||||
## Install
|
||||
|
||||
|
|
@ -11,7 +10,6 @@ Having tool specific config in package.json reduces the amount of metafiles in y
|
|||
$ npm install pkg-conf
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```json
|
||||
|
|
@ -25,26 +23,23 @@ $ npm install pkg-conf
|
|||
```
|
||||
|
||||
```js
|
||||
const pkgConf = require('pkg-conf');
|
||||
import {packageConfig} from 'pkg-conf';
|
||||
|
||||
(async () => {
|
||||
const config = await pkgConf('unicorn');
|
||||
const config = await packageConfig('unicorn');
|
||||
|
||||
console.log(config.rainbow);
|
||||
//=> true
|
||||
})();
|
||||
console.log(config.rainbow);
|
||||
//=> true
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
It [walks up](https://github.com/sindresorhus/find-up) parent directories until a `package.json` can be found, reads it, and returns the user specified namespace or an empty object if not found.
|
||||
|
||||
### pkgConf(namespace, [options])
|
||||
### packageConfig(namespace, options?)
|
||||
|
||||
Returns a `Promise` for the config.
|
||||
|
||||
### pkgConf.sync(namespace, [options])
|
||||
### packageConfigSync(namespace, options?)
|
||||
|
||||
Returns the config.
|
||||
|
||||
|
|
@ -56,24 +51,24 @@ The package.json namespace you want.
|
|||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
Type: `object`
|
||||
|
||||
##### cwd
|
||||
|
||||
Type: `string`<br>
|
||||
Type: `string`\
|
||||
Default: `process.cwd()`
|
||||
|
||||
Directory to start looking up for a package.json file.
|
||||
The directory to start looking up for a package.json file.
|
||||
|
||||
##### defaults
|
||||
|
||||
Type: `Object`<br>
|
||||
Type: `object`
|
||||
|
||||
Default config.
|
||||
The default config.
|
||||
|
||||
##### skipOnFalse
|
||||
|
||||
Type: `boolean`<br>
|
||||
Type: `boolean`\
|
||||
Default: `false`
|
||||
|
||||
Skip `package.json` files that have the namespaced config explicitly set to `false`.
|
||||
|
|
@ -90,20 +85,14 @@ Example usage for the user:
|
|||
}
|
||||
```
|
||||
|
||||
### pkgConf.filepath(config)
|
||||
### packageJsonPath(config)
|
||||
|
||||
Pass in the `config` returned from any of the above methods.
|
||||
|
||||
Returns the filepath to the package.json file or `null` when not found.
|
||||
Pass in the config returned from any of the above methods.
|
||||
|
||||
Returns the file path to the package.json file or `undefined` if not found.
|
||||
|
||||
## Related
|
||||
|
||||
- [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file
|
||||
- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file
|
||||
- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue