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

@mintlab/cherrypack

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mintlab/cherrypack

Do different things depending on NODE_ENV.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-82.26%
Maintainers
5
Weekly downloads
 
Created
Source

@mintlab/cherrypack npm version

Do different things depending on NODE_ENV.

Installation

$ yarn add @mintlab/cherrypack

Usage

The package exports a function that is called with an object that uses the environments as property names.

const cherrypack = require('cherrypack');

module.exports = cherrypack({
  development: 'foo', // export `foo` in production
  production: 'bar',  // export `bar` in production
});

If you need to require and execute complex and expensive code, you can encapsulate that with a method that will be used as a callback:

module.exports = cherrypack({
  development() {
    return new require('ExpensiveDevelopmentClass')(/* complex argument(s) */);
  },
  production() {
    return new require('ExpensiveProductionClass')(/* complex argument(s) */);
  },
});

If process.env.NODE_ENV is not set, it defaults to development;

License

Copyright Mintlab B.V.

Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence").

You may not use this work except in compliance with the Licence.

You may obtain a copy of the Licence at: https://joinup.ec.europa.eu/software/page/eupl

FAQs

Package last updated on 29 Nov 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