meshblu-config
Meshblu Config from environment or JSON file
Last updated 3 years ago by octoblu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install meshblu-config 
SYNC missed versions from official npm registry.

meshblu-config

Meshblu Config from environment or JSON file

Install

npm install meshblu-config

Usage

var MeshbluConfig = require('meshblu-config');
var meshbluConfig = new MeshbluConfig();
var config = meshbluConfig.generate({});

var Meshblu = require('meshblu');
var meshblu = Meshblu.createConnection(config);

Options (showing default values)

Functions

Constructor

Parameter Type Required Description
options object no can contain any of these keys: envVars, defaultFilename, env

var meshbluConfig = new MeshbluConfig({envVars: {uuid: "MESHBLU_UUID", resolveSrv: "MESHBLU_RESOLVE_SRV"}})
var meshbluConfig = new MeshbluConfig({defaultFilename: './something-like-meshblu.json'})
var meshbluConfig = new MeshbluConfig({env: {"MESHBLU_UUID": "the-uuid"}})

generate

Parse the default file, environment, and data and return the combined configuration

Parameter Type Required Description
data object no Data to process

var data = meshbluConfig.generate()

Advanced Functions

get

Returns the current config

Parameter Type Required Description

var data = meshbluConfig.get();

fromFile

Loads any values from the JSON file into the config

Parameter Type Required Description
filename string no JSON file to parse, defaults to ``./meshblu.json`

meshbluConfig.fromFile('./filename.json')
var data = meshbluConfig.get();

fromEnv

Loads any values from the env

Parameter Type Required Description
env object no Environment to use, defaults to process.env

meshbluConfig.fromEnv({"MESHBLU_UUID": "the-uuid"})
var data = meshbluConfig.get();

fromData

Loads any values from the env

Parameter Type Required Description
data object yes Data to use

meshbluConfig.fromData({uuid: "the-uuid"})
var data = meshbluConfig.get();

Current Tags

  • 9.0.2                                ...           latest (3 years ago)

26 Versions

  • 9.0.2                                ...           3 years ago
  • 9.0.1                                ...           3 years ago
  • 8.0.1                                ...           3 years ago
  • 8.0.0                                ...           3 years ago
  • 7.0.0                                ...           4 years ago
  • 6.4.3                                ...           4 years ago
  • 6.4.2                                ...           4 years ago
  • 6.4.1                                ...           4 years ago
  • 6.4.0                                ...           4 years ago
  • 6.3.0                                ...           4 years ago
  • 6.2.0                                ...           4 years ago
  • 6.1.0                                ...           4 years ago
  • 6.0.0                                ...           4 years ago
  • 5.2.0                                ...           4 years ago
  • 5.1.2                                ...           4 years ago
  • 5.1.1                                ...           4 years ago
  • 5.0.0                                ...           4 years ago
  • 4.1.3                                ...           4 years ago
  • 4.0.0                                ...           5 years ago
  • 3.2.0                                ...           5 years ago
  • 3.1.1                                ...           5 years ago
  • 3.1.0                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 2.2.0                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (6)
Dependents (163)

Copyright 2014 - 2016 © taobao.org |