npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

resin-settings-client

3.8.8 • Public • Published

resin-settings-client

npm version dependencies Build Status Build status

Join our online chat at Gitter chat

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) ⇒ *

Kind: static method of settings
Summary: Get a setting
Returns: * - setting value
Access: public

Param Type Description
name String setting name

Example

settings.get('dataDirectory')

settings.getAll() ⇒ Object

Kind: static method of settings
Summary: Get all settings
Returns: Object - all settings
Access: public
Example

settings.getAll()

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

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.

install

npm i resin-settings-client

Downloadsweekly downloads

156

version

3.8.8

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability