Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fable-settings

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fable-settings

A simple, tolerant configuration chain.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
303
decreased by-46.37%
Maintainers
2
Weekly downloads
 
Created
Source

Fable Settings

A very simple, tolerant settings loading library.

Code Climate Coverage Status Build Status Dependency Status devDependency Status

Why

It became tiring to see a heap of boilerplate config file/defaults loading at the top of microservices and the like.

How

Install it with npm.

$ npm install fable-settings

Fire it up and access some settings:

var settings = require('fable-settings').new({Product: 'SomeProduct', Version: '9.10.11'});
console.log('My product: '+settings.settings.Product);
console.log('My version: '+settings.settings.Version);

Wanna get tricky? Load settings from JSON:

var settings = require('fable-settings').new({Product: 'SomeProduct', Version: '9.10.11', ConfigFile: '/home/strongbad/config.json'});

Or even merge settings in later:

var settings = require('fable-settings').new({Product: 'SomeProduct', Version: '9.10.11'});
console.log('My product: '+settings.settings.Product);
console.log('My version: '+settings.settings.Version);
settings.merge({FavoriteTool:'Slap Chop'});
console.log('My Favorite Tool: '+settings.settings.FavoriteTool);

Unit Testing

You can run the unit tests by executing:

$ npm test

Or you can get the istanbul coverage report by executing:

$ npm run coverage

Keywords

FAQs

Package last updated on 17 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc