
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
[![npm version][npm-version-src]][npm-version-href] [![npm version][codecov-src]][codecov-href] [![Master Workflow][workflow-src]][workflow-href] [![Known Vulnerabilities][snyk-src]][snyk-href] [![Conventional Commits][conventional-src]][conventional-href
This library simplifies reading, transforming, and requiring environment variables across runtimes like Node.js, Deno, Bun.js, Browser, and more.
Table of Contents
npm install envix --save
The write method makes it possible to set an environment variable retrospectively for later accesses.
import { write } from 'envix';
write('foo', 'bar');
The read method accepts the key of the environment variable as the first argument and an alternative value as the second argument, which is returned if the variable does not exist. If no argument is passed, an object with all environment variables is returned.
import { read, write } from 'envix';
write('foo', 'bar');
read('foo'); // string | undefined
// bar
read('bar', 'baz'); // string
// baz
The readArray method makes it possible to read an environment variable as a string array. A fallback value can be defined as the second argument.
import { readArray, write } from 'envix';
write('foo', 'bar,baz');
readArray('foo'); // string[] | undefined
// ['bar', 'baz']
readArray('bar', ['foo']); // string[]
// ['foo']
The readBool method makes it possible to read an environment variable as a boolean. A fallback value can be defined as the second argument.
import { readBool, write } from 'envix';
write('foo', 'true');
readBool('foo'); // boolean | undefined
// true
readBool('bar', false); // boolean
// false
The readFloat method makes it possible to read an environment variable as a float. A fallback value can be defined as the second argument.
import { readFloat, write } from 'envix';
write('foo', '1');
readFloat('foo'); // number | undefined
// 1.0
readFloat('bar', 2.0); // number
// 2.0
The readInt method makes it possible to read an environment variable as a integer. A fallback value can be defined as the second argument.
import { readInt, write } from 'envix';
write('foo', '1.0');
readInt('foo'); // number | undefined
// 1
readInt('bar', 2); // number
// 2
The readNumber method makes it possible to read an environment variable as a number. A fallback value can be defined as the second argument.
import { readNumber, write } from 'envix';
write('foo', '1.0');
readNumber('foo'); // number | undefined
// 1.0
readNumber('bar', 2.0); // number
// 2.0
The readNumberArray method makes it possible to read an environment variable as a number array. A fallback value can be defined as the second argument.
import { readNumberArray, write } from 'envix';
write('foo', '1.0,2.1');
readNumberArray('foo'); // number[] | undefined
// [1.0,2.1]
readNumberArray('bar', [2,3]); // number[]
// [2,3]
Before starting to work on a pull request, it is important to review the guidelines for contributing and the code of conduct. These guidelines will help to ensure that contributions are made effectively and are accepted.
Made with 💚
Published under MIT License.
FAQs
[![npm version][npm-version-src]][npm-version-href] [![npm version][codecov-src]][codecov-href] [![Master Workflow][workflow-src]][workflow-href] [![Known Vulnerabilities][snyk-src]][snyk-href] [![Conventional Commits][conventional-src]][conventional-href
The npm package envix receives a total of 61,911 weekly downloads. As such, envix popularity was classified as popular.
We found that envix demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.