
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Hierarchical configuration with files and environment variables for node and the browser
┌─┐┌─┐┌┐┌┌─┐┬┌─┐┌─┐
│ │ ││││├┤ ││ ┬│ │
└─┘└─┘┘└┘└ ┴└─┘└─┘
Hierarchical configuration with files and environment variables for node and the browser.
npm i --save configo
1. Create a config
folder at the root of your project. Within it, create a default
folder.
mkdir config
mkdir config/default
2. Within the default
folder, create a private.js
file that exports an Object
containing your private configuration variables. Once that's done, create a public.js
file that does the same but for your publicly accessible configuration variables.
// ./config/default/private.js
module.exports = {
WHO_IS_BATMAN: 'Bruce Wayne'
};
// ./config/default/public.js
module.exports = {
NODE_ENV: process.env.NODE_ENV
};
3. Require configo
on the server and in browsers (using browserify) and easily access your configuration variables.
// On the server
var conf = require('configo');
console.log(conf.get('WHO_IS_BATMAN')); // Bruce Wayne
console.log(conf.get('NODE_ENV')); // production
// In browsers
var conf = require('configo');
console.log(conf.get('WHO_IS_BATMAN')); // undefined
console.log(conf.get('NODE_ENV')); // production
NOTE: Your private configuration variables are not included in the outputted browserify file.
Retrieves a key from your config.
Arguments
key
- The variable you want to retrieve from your configuration.Examples
var conf = require('configo');
var AWS_SECRET_KEY = conf.get('AWS_SECRET_KEY'); // SUPERSECRETAWSSECRETKEY
Overwrites a variable in your configuration or sets a new one if the variable doesn't exist.
Arguments
key
- The name of the variable you want to overwrite or sets it on your configo instance.value
- The value you want to store.Examples
var conf = require('configo');
conf.set('FOO', 'bar');
console.log(conf.get('FOO')); // bar
FAQs
Hierarchical configuration with files and environment variables for node and the browser
The npm package configo receives a total of 0 weekly downloads. As such, configo popularity was classified as not popular.
We found that configo 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.