40 lines
2.1 KiB
Markdown
40 lines
2.1 KiB
Markdown
# smartenv
|
|
store things about your environment and let them travel across modules
|
|
|
|
## Availabililty
|
|
[](https://www.npmjs.com/package/smartenv)
|
|
[](https://gitlab.com/pushrocks/smartenv)
|
|
[](https://github.com/pushrocks/smartenv)
|
|
[](https://pushrocks.gitlab.io/smartenv/)
|
|
|
|
## Status for master
|
|
[](https://gitlab.com/pushrocks/smartenv/commits/master)
|
|
[](https://gitlab.com/pushrocks/smartenv/commits/master)
|
|
[](https://david-dm.org/pushrocks/smartenv)
|
|
[](https://www.bithound.io/github/pushrocks/smartenv/master/dependencies/npm)
|
|
[](https://www.bithound.io/github/pushrocks/smartenv)
|
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
[](http://standardjs.com/)
|
|
|
|
## Install
|
|
Install the package through npm
|
|
|
|
```
|
|
npm install smartenv --save
|
|
```
|
|
|
|
## Usage
|
|
|
|
```javascript
|
|
var smartenv = require("smartenv");
|
|
|
|
smartenv.info(); //prints an output about your current environment and registered objects
|
|
smartenv.register({akey:"a text"},"somevalue"); // register a new object
|
|
smartenv.makeGlobal() // make smartenv available from gobal.smartenv
|
|
smartenv.get("somevalue").akey; // returns "a text"
|
|
smartenv.items.somevalue.akey; // also returns "a text"
|
|
```
|
|
|
|
[](https://push.rocks)
|