
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
config-settings
Advanced tools
npm install config-settings --save
{
"var":"xxxx",
"integer":111,
"dir":"/var/xxx",
"dirNotExist":"1234567890qwerty",
"file":"/var/filename",
"fileDirExist":"/var/filenotexist",
"fileNotExist":"098987655oiouyuyt",
"int":11,
"notInt":"xx",
"url":"http://baidu.com"
}
const config = require('../config.json');
const {JsonConfig} = require('config-settings');
const jsonConfig = new JsonConfig(config);
var varstr = jsonConfig.loadNecessaryVar('var');//get xxxx
var integer = jsonConfig.loadNecessaryVar('integer');//get 111
const {ConsulConfig} = require('config-settings');
const settings = new ConsulConfig({consulAddr:'127.0.0.1:8500'});
settings.loadNecessaryVar('var').then(function(value) {
const varstr = value;
});
settings.loadNecessaryVar('integer').then(function(value) {
const integer = value;
});
settings.allLoaded().then(function() {
//all loading progress finished
}).catch(function() {
});
const {ConsulSyncConfig} = require('config-settings');
const settings = new ConsulConfig({consulAddr:'127.0.0.1:8500', keys: ['var', 'integer']});
const varstr = settings.loadNecessaryVar('var');
const integer = settings.loadNecessaryVar('integer');
Attention
When call the function start with loadNecessary
failed, the module will throw Error in asynchronous way.
See the document of api
You should set the environment variable of CONSUL_SERVER
in format of ip:port
before npm run
.
v2.3.1
FAQs
Reading configuration from json file or consul.
We found that config-settings demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.