Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

envix

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

envix

[![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

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
47K
decreased by-0.94%
Maintainers
1
Weekly downloads
 
Created
Source

envix ⚙️

npm version npm version Master Workflow Known Vulnerabilities Conventional Commits

This library simplifies reading, transforming, and requiring environment variables across runtimes like Node.js, Deno, Bun.js, Browser, and more.

Table of Contents

Installation

npm install envix --save

Usage

Set

import { set } from 'envix';

set('foo', 'bar');

Read

import { read, set } from 'envix';

set('foo', 'bar');

read('foo'); // string | undefined
// bar

read('bar', 'baz'); // string
// baz

Read Array

import { readArray, set } from 'envix';

set('foo', 'bar,baz');

readArray('foo'); // string[] | undefined
// ['bar', 'baz']

Read Bool

import { readBool, set } from 'envix';

set('foo', 'true');

readBool('foo'); // boolean | undefined
// true

Read Number

import { readNumber, set } from 'envix';

set('foo', '1.0');

readNumber('foo'); // number | undefined
// 1.0

Read Number Array

import { readNumberArray, set } from 'envix';

set('foo', '1.0,2.1');

readNumberArray('foo'); // number[] | undefined
// [1.0,2.1]

Contributing

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.

License

Made with 💚

Published under MIT License.

FAQs

Package last updated on 08 Feb 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc