Socket
Socket
Sign inDemoInstall

app-env

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    app-env

Global environment variables for JS runtime


Version published
Weekly downloads
5
increased by25%
Maintainers
1
Install size
1.85 kB
Created
Weekly downloads
 

Readme

Source

app-env

Tries to be environment variables in JS runtime, global variables really, just not on window or self object. Still be cautious, two packages using app-env, and one is dependency of another and both call env.set('url', someValue). It will change value of url for both of them, causing unexpected behaviour.

Usage

Install

$ npm i app-env

Use

import env from 'app-env';

API

env.set(key: string, value: any, [modifiable: boolean])

Sets a value for given key, can be prevented from further modification by setting modifiable to false, in which case another attempt will throw TypeError.

env.get(key: string)

Gets value of given key, same as env.KEY_NAME_HERE

Keywords

FAQs

Last updated on 13 Nov 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc