npmextra/docs/index.md

67 lines
2.9 KiB
Markdown
Raw Normal View History

2017-04-02 09:55:45 +00:00
# npmextra
2017-04-02 09:55:45 +00:00
do more with npm
## Availabililty
2017-04-02 09:55:45 +00:00
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/npmextra)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/npmextra)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/npmextra)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/npmextra/)
## Status for master
2017-04-02 09:55:45 +00:00
[![build status](https://GitLab.com/pushrocks/npmextra/badges/master/build.svg)](https://GitLab.com/pushrocks/npmextra/commits/master)
[![coverage report](https://GitLab.com/pushrocks/npmextra/badges/master/coverage.svg)](https://GitLab.com/pushrocks/npmextra/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/npmextra.svg)](https://www.npmjs.com/package/npmextra)
[![Dependency Status](https://david-dm.org/pushrocks/npmextra.svg)](https://david-dm.org/pushrocks/npmextra)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/npmextra/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/npmextra/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/npmextra/badges/code.svg)](https://www.bithound.io/github/pushrocks/npmextra)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
2017-04-02 09:55:45 +00:00
Use TypeScript for best in class instellisense.
2017-07-20 15:13:01 +00:00
## Using npmextra for managing toolconfigs
2017-04-02 09:55:45 +00: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
2017-04-02 09:55:45 +00:00
```json
{
"sometool": {
"defaultKey1": "awesomeValueFromConfig"
}
2017-04-02 09:55:45 +00:00
}
```
```typescript
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 09:55:45 +00:00
```
2017-07-20 15:13:01 +00:00
### Tools that already use the config feature of npmextra
- [npmts](https://www.npmjs.com/package/npmts)
- [npmci](https://www.npmjs.com/package/npmci)
- [npmdocker](https://www.npmjs.com/package/npmdocker)
2017-07-20 15:13:01 +00:00
2017-07-20 15:38:47 +00:00
## Using the KeyValueStore
2017-04-02 09:55:45 +00: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)
2017-04-02 09:55:45 +00:00
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)