Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
adon-config
Advanced tools
Readme
This module is used for managing system configurations in cascading order. It is able to load recursively load all the files in the folder and form the exact structure in the config object.
assuming you have a javascript config file with the following item in config/common
modules.export = {
test: {
something: 'eureka!'
}
}
you can retrieve them easily by
let config = require('adon-config').load(); //this should be one of the first line of code in your index file
config.load(__dirname);
console.log("My test value is " + config.get('test.something'));
$ npm install adon-config --save
root
|-config
| |-common
| | |-server.js
| | |-database.js
| |-env
| | |-development
| | | |-server.js
| | | |-test.js
| | |-production
| | | |-server.js
|-index.js
in the sample above, we have 2 configurations that will be common across all environments. The config object will contain the attributes or elements named 'server' and 'database' based on the config files.
let config = require('adon-config').get()
console.log(config.database.source); //outputs the source value from common/database
The env (environment) overrides common configurations and will rely on the systm's NODE_ENV value. in the sample above, any duplicate values in config.server (based from common/server.js) will be overridden by the environment version. any unique configuration that exists in an environment only exists for that environment (i.e. development/test.js)
###Load loads the config folder from the current project directory then returns the latest config object (this is the first code you must trigger to initialize this module)
let config = require('adon-config').load()
just returns the latest config object and do nothing else (used for succeeding requests where loading of configurations are no longer needed)
let config = require('adon-config').get()
adon-config relies on the following node modules
adon-config is publicly available on Github
FAQs
This module is used for managing system configurations in cascading order.
The npm package adon-config receives a total of 12 weekly downloads. As such, adon-config popularity was classified as not popular.
We found that adon-config 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.