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.
@loxjs/config
Advanced tools
Readme
A configuration management library for Node.js applications, @loxjs/config
provides a simple and fluent API for getting and setting configuration values, bulk updates, and merging configurations with defaults.
Install @loxjs/config
using npm:
npm install @loxjs/config
Or using yarn:
yarn add @loxjs/config
Here's a quick overview of how you can use @loxjs/config
.
First, import and initialize the module:
const Config = require('@loxjs/config');
const config = new Config({
// Initial configuration values
});
To set a configuration value:
config.set('path.to.setting', 'value');
To set multiple configuration values at once:
config.bulkSet({
'path.to.setting': 'value',
'another.path.to.setting': 'another value'
});
To get a configuration value, use:
const value = config.get('path.to.setting');
To get a configuration value with a defaultValue
, defaultValue
is returned when configuration value is undefined
:
const value = config.get('path.to.setting', 'defaultValue');
To get a configuration value and set it if it doesn't exist:
const value = config.geset('path.to.setting', 'defaultValue');
To check if a configuration value equals a specific value:
const isEqual = config.eq('path.to.setting', 'value');
To check if a configuration value does not equal a specific value:
const isNotEqual = config.ne('path.to.setting', 'value');
To merge a set of default values with existing configuration:
const mergedConfig = config.merge('path.to.setting', {
defaultKey: 'defaultValue',
anotherDefaultKey: 'anotherDefaultValue'
});
Contributions to @loxjs/config
are welcome! Please ensure that your contributions adhere to the following guidelines:
For more detailed information, please read the contributing guide.
Enjoy using @loxjs/config
!
FAQs
A configuration management library for Node.js applications
The npm package @loxjs/config receives a total of 5 weekly downloads. As such, @loxjs/config popularity was classified as not popular.
We found that @loxjs/config demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.