
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
get-env-var
Advanced tools
A little function that reads an environment variable from
process.env
with support for default values and a optional mapping
function applied to the data read from the environment.
It will thrown an exception if key can't be found and no default value is supplied.
var getEnvVar = require('get-env-var');
getEnvVar('SOME_VAL', 'defaultValue');
getEnvVar('SOME_INT_VAL', Number.parseInt);
getEnvVar('SOME_INT_VAL', 20, Number.parseInt);
The following shorthand methods currently exists. They have the same API as the generic method. The mapping function is applied to the transformed value.
getEnvVar.boolean
is a shorthand method that returns true if the
value equals 'true' and false in all other cases.
getEnvVar.integer
is a shorthand method that calls parseInt(value, 10)
.
MIT
[2.0.0] - 2016-03-17
undefined
is no longer a supported default valueFAQs
Get environment variable
The npm package get-env-var receives a total of 4 weekly downloads. As such, get-env-var popularity was classified as not popular.
We found that get-env-var demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.