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.
@jcoreio/require-env
Advanced tools
get value of an environment variable; throw if undefined or empty string
A simple function that returns the value of an environment variable, but throws if it's not a non-empty string.
Logs the entire environment to console.error
to aid debugging.
Flow type defs included.
npm install --save @jcoreio/require-env
var requireEnv = require('require-env')
var FOO = requireEnv('FOO')
// now you can be sure that FOO is a non-empty string, and Flow will trust that it is too.
By default it looks in process.env
, but you can override this by passing the environment
hash as the second argument:
var environment = {...process.env, ...require('./defaultEnv.js')}
var FOO = requireEnv('FOO', environment)
defaultenv
- fantastic CLI/Node API for loading default environment variable valuesIn the past Error
s thrown had all environment variables in their message
s.
I've since realized this was a huge security risk when error messages are sent
from server to client. Now the message and environment variables are printed to
console.error
. You can customize this by monkeypatching the
require('@jcoreio/require-env').logError
function.
FAQs
get value of an environment variable; throw if undefined or empty string
The npm package @jcoreio/require-env receives a total of 127 weekly downloads. As such, @jcoreio/require-env popularity was classified as not popular.
We found that @jcoreio/require-env demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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
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.