2017-04-02 11:55:45 +02:00
# npmextra
2018-08-31 01:11:09 +02:00
2017-04-02 11:55:45 +02:00
do more with npm
## Availabililty
2018-08-31 01:11:09 +02:00
2017-04-02 11:55:45 +02:00
[](https://www.npmjs.com/package/npmextra)
[](https://GitLab.com/pushrocks/npmextra)
[](https://github.com/pushrocks/npmextra)
[](https://pushrocks.gitlab.io/npmextra/)
## Status for master
2018-08-31 01:11:09 +02:00
2017-04-02 11:55:45 +02:00
[](https://GitLab.com/pushrocks/npmextra/commits/master)
[](https://GitLab.com/pushrocks/npmextra/commits/master)
[](https://www.npmjs.com/package/npmextra)
[](https://david-dm.org/pushrocks/npmextra)
[](https://www.bithound.io/github/pushrocks/npmextra/master/dependencies/npm)
[](https://www.bithound.io/github/pushrocks/npmextra)
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
[](http://standardjs.com/)
## Usage
2018-08-31 01:11:09 +02:00
2017-04-02 11:55:45 +02:00
Use TypeScript for best in class instellisense.
2017-07-20 17:13:01 +02:00
## Using npmextra for managing toolconfigs
2018-08-31 01:11:09 +02:00
2017-04-02 11:55:45 +02:00
The main purpose of npmextra is to configure different tools using one npmextra.json. This way complex setups avoid additional complexity caused by too many configuration files.
npmextra.json
2018-08-31 01:11:09 +02:00
2017-04-02 11:55:45 +02:00
```json
{
2018-08-31 01:11:09 +02:00
"sometool": {
"defaultKey1": "awesomeValueFromConfig"
}
2017-04-02 11:55:45 +02:00
}
```
```typescript
2018-08-31 01:11:09 +02:00
import { Npmextra } from 'npmextra';
let myNpmExtra = new Npmextra('my/path/to/cwd'); // cwd argument is optional
mergedData = myNpmExtra.dataFor('sometool', {
// gets merged with whatever is in the configfile
defaultKey1: 'defaultValue1', // so this will get overwritten with "awesomeValueFromConfig"
defaultKey2: 'defaultValue2' // this one will pass through unaltered
});
2017-04-02 11:55:45 +02:00
```
2017-07-20 17:13:01 +02:00
### Tools that already use the config feature of npmextra
2018-08-31 01:11:09 +02:00
- [npmts ](https://www.npmjs.com/package/npmts )
- [npmci ](https://www.npmjs.com/package/npmci )
- [npmdocker ](https://www.npmjs.com/package/npmdocker )
2017-07-20 17:13:01 +02:00
2017-07-20 17:38:47 +02:00
## Using the KeyValueStore
2017-04-02 11:55:45 +02:00
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
2018-08-31 01:11:09 +02:00
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
2017-04-02 11:55:45 +02:00
[](https://push.rocks)