
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
assert-process-env
Advanced tools
Simple module that loads env variables from process.env
and asserts they exist. Reduces boilerplate if you are loading lots of envs and performing assertions.
npm install --save assert-process-env
const assertProcessEnv = require('assert-process-env');
// Load an env and perform and assertion to ensure it exists
const ENV1 = assertProcessEnv('ENV1');
// Add a custom validator
const ENV2 = assertProcessEnv('ENV2', val => ['one', 'two'].includes(val));
// Display a custom message
const ENV3 = assertProcessEnv('ENV3', 'We forgot ENV3... Cmon...');
key
: Required. The name of your variable. Will be loaded as process.env[key]
validator
: Optional. Function to perform additional validation. Assertion will throw if a falsy value is returned.message
: Optional. Message to display in the assertion. A default message will be used if nothing is provided.MIT
FAQs
Load process.env variables and assert they exist.
The npm package assert-process-env receives a total of 745 weekly downloads. As such, assert-process-env popularity was classified as not popular.
We found that assert-process-env 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.