🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

filter-env

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filter-env

Filter environment variables by pattern

1.1.2
latest
Source
npm
Version published
Weekly downloads
21
110%
Maintainers
1
Weekly downloads
 
Created
Source

filter-env

filter-env iterates over process.env and returns an object containing environment variables whose name matches a regular expression. Optionally, it can parse environment variable values as JSON.

Circle CI bitHound Overall Score bitHound Dependencies

Usage

const config = filterEnv(/^TEST-/, { json: true, freeze: true });

Arguments

  • validate: A validation function or regular expression to test the environment variable key
  • options: Optional configuration
    • json: true to parse environment variable value as JSON. Throws an error if a value is not valid JSON. Defaults to false
    • immutable: true to freeze the returned object (and child objects). Defaults to false
    • format: A function that formats the environment variable name in the returned object. If the format function returns a key that already exists, the variable will not be included in the returned object. By default, the key is not changed.

Keywords

config

FAQs

Package last updated on 22 Feb 2016

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