48 lines
2.3 KiB
Markdown
48 lines
2.3 KiB
Markdown
# npmextra
|
|
do more with npm.
|
|
|
|
npmextra is a hub for a series of js tools that help writing, documenting and maintaining npm modules.
|
|
|
|
## Availabililty
|
|
[](https://www.npmjs.com/package/npmpage)
|
|
[](https://gitlab.com/pushrocks/npmpage)
|
|
[](https://github.com/pushrocks/npmpage)
|
|
[](https://pushrocks.gitlab.io/npmpage/)
|
|
|
|
## Status for master
|
|
[](https://gitlab.com/pushrocks/npmpage/commits/master)
|
|
[](https://gitlab.com/pushrocks/npmpage/commits/master)
|
|
[](https://david-dm.org/pushrocks/npmpage)
|
|
[](https://www.bithound.io/github/pushrocks/npmpage/master/dependencies/npm)
|
|
[](https://www.bithound.io/github/pushrocks/npmpage)
|
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
[](http://standardjs.com/)
|
|
|
|
## Usage
|
|
The main purpose of npmextra is to configure different tools using one npmextra.json. This way complex setups avaoid complexity through many configuration files.
|
|
|
|
npmextra.json
|
|
```json
|
|
{
|
|
"sometool": {
|
|
"defaultKey1": "awesomeValueFromConfig"
|
|
}
|
|
}
|
|
```
|
|
|
|
```typescript
|
|
import * as npmextra from 'npmextra'
|
|
|
|
npmextra.dataFor({
|
|
toolName:'sometool',
|
|
defaultSettings: { // 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
|
|
},
|
|
cwd?: string // lets you specifiy a custom current working directory to look for the npmextra.json
|
|
})
|
|
```
|
|
|
|
[](https://push.rocks)
|