3.0.2 • Published 2 years ago

@tycrek/isprod v3.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

isprod

NPMCBT badge

A glorified regular expression.

I wanted what linkeo/isprod had made but didn't like the very outdated codebase that used some old concepts. So I rewrote it into what is essentially a glorified Regular Expression.

Usage

  1. Install with npm i @tycrek/isprod
  2. Set your NODE_ENV to production using your preferred method (it must be accessible from process.env).
  3. Use it:

    import isProd from '@tycrek/isprod';
    
    console.log(isProd());
    
    // or, to enable strict mode:
    console.log(isProd(true));
    
    // output: true or false

Modes

LazyStrict
isProd()isProd(true)
Matches "prod" or moreMatches only "production"

Testing

Modify .env.test to your liking and run npm run test.

Contributing

You do realize this entire project can be replaced with less than a line of code right? (But by all means any contributions are welcome!)