
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
@postnord/pretty-env
Advanced tools
This module gives you a nice interface to handle environment variables.
import envService from '@postnord/pretty-env'
// in batch
const { API_BASE_URL, NODE_URL } = envService.requireEnvs({ envs: ['API_BASE_URL', 'NODE_URL'] }) // returned envs are typed as string, so no more process.env.NODE_URL as string
// single env var fetch
const myEnv = envService.requireSingleEnv({ env: 'mySingleEnv' })
// When the env does not exist
envService.requireSingleEnv({ env: 'myNonExistingEnv' }) // throws "Environment variable myNonExistingEnv is missing"
// If you want to parse and validate the value
envService.requireSingleEnv<Array<string>>({
env,
parser: JSON.parse,
validateValue: {
validationFunction: Array.isArray,
errorMessage: 'Should be an array but is not',
}
})
FAQs
Easily handle env vars
We found that @postnord/pretty-env demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 17 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.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.