2016-07-17 01:42:23 +02:00
# npmextra
2017-03-18 16:23:47 +01:00
do more with npm
2016-07-19 00:36:19 +02:00
2016-09-16 22:28:38 +02:00
## Availabililty
2017-03-18 16:23:47 +01:00
[](https://www.npmjs.com/package/npmextra)
[](https://GitLab.com/pushrocks/npmextra)
[](https://github.com/pushrocks/npmextra)
[](https://pushrocks.gitlab.io/npmextra/)
2016-09-16 22:28:38 +02:00
## Status for master
2017-03-18 16:23:47 +01:00
[](https://GitLab.com/pushrocks/npmextra/commits/master)
[](https://GitLab.com/pushrocks/npmextra/commits/master)
[](https://www.npmjs.com/package/npmextra)
2016-09-17 18:12:32 +02:00
[](https://david-dm.org/pushrocks/npmextra)
[](https://www.bithound.io/github/pushrocks/npmextra/master/dependencies/npm)
[](https://www.bithound.io/github/pushrocks/npmextra)
2016-09-16 22:28:38 +02:00
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
[](http://standardjs.com/)
2016-07-19 00:36:19 +02:00
## Usage
2017-03-18 16:23:47 +01:00
Use TypeScript for best in class instellisense.
2016-09-18 16:09:27 +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.
2016-07-19 00:36:19 +02:00
2016-09-16 22:28:38 +02:00
npmextra.json
```json
{
"sometool": {
"defaultKey1": "awesomeValueFromConfig"
}
}
```
2016-07-19 00:36:19 +02:00
```typescript
2016-09-24 16:52:38 +02:00
import { Npmextra } from 'npmextra'
2016-09-16 22:28:38 +02:00
2016-09-24 16:52:38 +02:00
let myNpmExtra = new Npmextra('my/path/to/cwd') // cwd argument is optional
mergedData = myNpmExtra.dataFor(
'sometool',
{ // gets merged with whatever is in the configfile
2016-09-16 22:28:38 +02:00
defaultKey1: 'defaultValue1', // so this will get overwritten with "awesomeValueFromConfig"
defaultKey2: 'defaultValue2' // this one will pass through unaltered
2016-09-24 16:52:38 +02:00
}
)
2016-09-16 22:28:38 +02:00
```
2016-07-19 00:36:19 +02:00
2017-03-18 16:23:47 +01:00
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy ](https://lossless.gmbH/privacy.html )
[](https://push.rocks)