🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

meshblu-config

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meshblu-config

Meshblu Config from environment or JSON file

latest
Source
npmnpm
Version
9.0.2
Version published
Weekly downloads
101
36.49%
Maintainers
1
Weekly downloads
 
Created
Source

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

ParameterTypeRequiredDescription
optionsobjectnocan 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

ParameterTypeRequiredDescription
dataobjectnoData to process
var data = meshbluConfig.generate()

Advanced Functions

get

Returns the current config

ParameterTypeRequiredDescription
var data = meshbluConfig.get();

fromFile

Loads any values from the JSON file into the config

ParameterTypeRequiredDescription
filenamestringnoJSON file to parse, defaults to ``./meshblu.json`
meshbluConfig.fromFile('./filename.json')
var data = meshbluConfig.get();

fromEnv

Loads any values from the env

ParameterTypeRequiredDescription
envobjectnoEnvironment to use, defaults to process.env
meshbluConfig.fromEnv({"MESHBLU_UUID": "the-uuid"})
var data = meshbluConfig.get();

fromData

Loads any values from the env

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

Keywords

Meshblu

FAQs

Package last updated on 10 Aug 2017

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