Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
configurations
Advanced tools
Loads configuration files depending on the environment, the users individual configuration, additional configuration files that are explicitly defined and CLI parameters.
Creates a configurations hash out of several overlapping configuration files.
baseDir
the directory configurations are loaded fromadditionalParameters
optional additional Parameters e.g. from cli argumentsThe config file default.(js|json)
is always loaded and is the base configuration.
The environment is used to load an additional configurations file.
Naming convention is {environment}.(js|json)
.
The environment configuration is optional.
For local development an configuration individual for every developer is useful.
Will be only loaded if the environment is development
.
Naming convention is user.{userName}.(js|json)
.
The user configuration is optional.
Additonal parameters can be specified via a options hash that will be merged into the configuration. cli arguments are a possible source.
Via the parameters hash the path to an additonal configurations file can be specified.
The key for the options hash os externalconfig
.
module.exports = {
foo: 'bar',
bax: 'baz',
spam: 'eggs'
};
module.exports = {
spam: 'eggs222'
};
var path = require('path');
var c = require('configurations');
var configuration = c.load(path.join(__dirname, '/config'), {
bax: 'bazzzz',
externalconfig: '/foo/bar/optionalConfig.js'
});
{
foo: 'bar',
bax: 'bazzzz',
spam: 'eggs222'
}
The file example/example.js
contains the following content:
var configuration = configurations.load(path.join(__dirname, '/config'), {
externalconfig: path.join(__dirname, 'config', 'optional.js'),
foo: 'foo-cli'
});
Run it with the following parameters:
$ NODE_ENV=development node example/example.js
result:
{ "a": "b", "foo": "foo-cli", "bax": "baz-development", "spam": "eggs2" }
$ NODE_ENV=production node example/example.js
result:
{ "a": "b", "foo": "foo-cli", "bax": "baz-production", "spam": "eggs2" }
$ NODE_ENV=foo node example/example.js
result:
{ "a": "b", "foo": "foo-cli", "bax": "baz", "spam": "eggs2" }
FAQs
manages multiple, competing configurations
The npm package configurations receives a total of 18 weekly downloads. As such, configurations popularity was classified as not popular.
We found that configurations 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.