
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.