New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

env-tool

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-tool

Helps working with environments easily

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

env-tool

Helps working with environments easily

Build Status Greenkeeper badge

Installation

npm install env-tool

or

yarn add env-tool

Usages

  • Run function in dev mode

    const env = require("env-tool");
    
    env.dev(function () {
      // runs in develpment
    });
    
    
  • Checks weather environment is production

    const env = require("env-tool");
    
    if (env.is.prod) {
      // true for production
    }
    
  • Log in development

    const env = require("env-tool");
    
    env.dev.warn("WARNING for development");
    
  • Run in not production

    env.not.prod(function () {
      // run on environment that is not production
    });
    

Configure

By default env-tool checks environment for node using process.env.NODE_ENV. However you can customize it yourself.

const env = require("env-tool");

env.setChecker(function (env) {
  return process.env.ENV === env;
});

License

MIT

FAQs

Package last updated on 30 Dec 2018

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