Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Load configs from hierarchical objects to process.env
By default econf tries to load .econf.js file
#Usage Import the econf at the top of your code to ensure that your configurations will be loaded before anything else
require('econf')();
optionally, you can specify the file name and custom env name
require('econf')('config.js', 'NODE_ENV');
#.econf.js example
module.exports = [
{
_name: 'newrelic',
NEW_RELIC_KEY: 'key'
},
{
_name: 'production',
NAME: 'Production Base',
AWS_SECRET: 'aws-secret',
AWS_KEY: 'aws-key',
EMAIL_DELAY: 1000
},
{
_name: 'production.001',
_extend: ['production', 'newrelic'],
NAME: 'Production 001',
EMAIL_DELAY: 0
}
]
#.econf.js example as object
module.exports = {
'newrelic': {
NEW_RELIC_KEY: 'key'
},
'production': {
NAME: 'Production Base',
AWS_SECRET: 'aws-secret',
AWS_KEY: 'aws-key',
EMAIL_DELAY: 1000
},
'production.001': {
_extend: ['production', 'newrelic'],
NAME: 'Production 001',
EMAIL_DELAY: 0
}
}
The config above will inject the code below into process.env
{
"_name": "production.001",
"_extend": [
"production",
"newrelic"
],
"NAME": "Production 001",
"EMAIL_DELAY": 0,
"AWS_SECRET": "aws-secret",
"AWS_KEY": "aws-key",
"NEW_RELIC_KEY": "key"
}
#Global Usage
npm install econf -g
With global version you can view your config parsed, just execute econf into your project directory
econf
To create a example .econf.js file into your project just execute econf init into your project directory
econf init
FAQs
Load configs from hierarchical objects to process.env
We found that econf 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
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.