Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@arundo/typed-env
Advanced tools
Typed environment variables using Zod.
npm install @arundo/typed-env
# or
yarn add @arundo/typed-env
# or
pnpm add @arundo/typed-env
Create a environment file with a schema and use typeEnvironment
to create a typed environment object:
// environment.ts
import { z } from 'zod';
import { typeEnvironment } from '@arundo/typed-env';
export const envSchema = z.object({
NODE_ENV: z.enum(['test', 'development', 'production']),
PORT: z.coerse.number().int().default(3000),
});
export const environment = typeEnvironment(envSchema);
Import the environment object and use it:
// server.ts
import { environment } from './environment';
console.log(environment.NODE_ENV); // 'development' - type string
console.log(environment.PORT); // 3000 - type number
Set naming convention of environment variables:
// environment.ts
/* ... as usual ... */
export const environment = typeEnvironment(envSchema, 'camelcase');
// server.ts
import { environment } from './environment';
console.log(environment.nodeEnv); // 'development' - type string
console.log(environment.port); // 3000 - type number
0.0.6
FAQs
Typed environment variables made easy 🚀
The npm package @arundo/typed-env receives a total of 277 weekly downloads. As such, @arundo/typed-env popularity was classified as not popular.
We found that @arundo/typed-env demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.