resin-settings-client
Resin.io client application shared settings.
Role
The intention of this module is to provice low level access to user configurable Resin.io simple settings.
THIS MODULE IS LOW LEVEL AND IS NOT MEANT TO BE USED BY END USERS DIRECTLY.
Unless you know what you're doing, use the Resin SDK instead.
Installation
Install resin-settings-client
by running:
$ npm install --save resin-settings-client
Documentation
This module attempts to retrieve configuration from the following places:
UNIX:
- Default settings.
$HOME/.resinrc.yml
.$PWD/resinrc.yml
.- Environment variables matching
RESINRC_<SETTING_NAME>
.
Windows:
- Default settings.
%UserProfile%\_resinrc.yml
.%cd%\resinrc.yml
.- Environment variables matching
RESINRC_<SETTING_NAME>
.
The values from all locations are merged together, with sources listed below taking precedence.
For example:
$ cat $HOME/.resinrc.yml resinUrl: 'resinstaging.io' projectsDirectory: '/opt/resin' $ cat $PWD/.resinrc.yml projectsDirectory: '/Users/resin/Projects' dataDirectory: '/opt/resin-data' $ echo $RESINRC_DATA_DIRECTORY /opt/cache/resin
That specific environment will have the following configuration:
resinUrl: 'resinstaging.io' projectsDirectory: '/Users/resin/Projects' dataDirectory: '/opt/cache/resin'
- settings
- .get(name) ⇒
*
- .getAll() ⇒
Object
- .get(name) ⇒
*
settings.get(name) ⇒ Kind: static method of settings
Summary: Get a setting
Returns: *
- setting value
Access: public
Param | Type | Description |
---|---|---|
name | String |
setting name |
Example
settings
Object
settings.getAll() ⇒ Kind: static method of settings
Summary: Get all settings
Returns: Object
- all settings
Access: public
Example
settings
Modifying settings
This module is intended to only provide read only access to the settings. Resin Settings Clients reads settings from various locations, like a local resinrc
file and a per user config
file, therefore the module doesn't know where to write changes back.
If you want to persist data related to Resin.io, consider using Resin Settings Storage instead.
Support
If you're having any problem, please raise an issue on GitHub and the Resin.io team will be happy to help.
Tests
Run the test suite by doing:
$ npm test
Contribute
- Issue Tracker: github.com/resin-io-modules/resin-settings-client/issues
- Source Code: github.com/resin-io-modules/resin-settings-client
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ npm run lint
License
The project is licensed under the Apache 2.0 license.