Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@studiohyperdrive/env
Advanced tools
Environment utility for NodeJS.
# NPM
npm install --save @studiohyperdrive/env
# Yarn
yarn add --save @studiohyperdrive/env
import Env from '@studiohyperdrive/env';
Fetches an environment variable as a string
.
get(key: string, allowNull = false): string
Usage:
const variable = Env.get('PARAM_NAME');
const nullableVariable = Env.get('PARAM_NAME', true);
Casts the fetched environment variable to a boolean
.
getAsBoolean(key: string): number
Usage:
const variable = Env.getAsBoolean('PARAM_NAME');
Casts the fetched environment variable to a number
.
getAsNumber(key: string): number
Usage:
const variable = Env.getAsNumber('PARAM_NAME');
Casts the fetched environment variable to an Array
.
getAsArray(key: string, separator = ','): number
Usage:
const variable = Env.getAsArray('PARAM_NAME', ';');
Casts the fetched environment variable to an object
using JSON.parse
.
getAsObject(key: string): number
Usage:
const variable = Env.getAsObject('PARAM_NAME');
Validate process.env
against a Joi Schema.
validateEnv(schema: Joi.Schema, options: Joi.ValidationOptions): ValidationResult
Usage:
const validationResult = Env.validateEnv(schema, options);
Validate process.env
against a Joi Schema in an asynchronous fashion.
validateEnvAsync(schema: Joi.Schema, options: Joi.ValidationOptions): ValidationResult
Usage:
const validationResult = await Env.validateEnvAsync(schema, options);
FAQs
Environment helper used at Studio Hyperdrive.
We found that @studiohyperdrive/env demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 15 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.