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

conire

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conire

conditional require of modules

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

conire

conditional require of modules

usage

var conire = require('conire')
// key used to find which module to require
// if key is falsy, fallback will be set
// if key is not falsy, it must be a string
var key = process.env.NODE_ENV;

// object containing module to be required
// key is used for lookup
// value is the name (string) of the module that needs to be required
// can not be an array
var drivers = {
  test: '../fixtures/mockHttp.js',
  production: 'secureHttp',
  development: 'looseHttp'
}

// optional fallback, defaults to null
// if string, it is treated as a module that needs to be required
// if anything else, it returns exactly what was passed in
var fallback = 'defaultHttp'

var networkDriver = conire(key, drivers, fallback);

Keywords

FAQs

Package last updated on 10 Mar 2015

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