hidden-require

0.0.1 • Public • Published

hidden-require Build Status

This library is intended at hiding and making some dependencies in node libraries optional when bundled in webpack/browserify.

Example:

const hiddenRequire = require('hidden-require');

/*
allow request to be optional to allow for other platforms to shim request
  fetch, google app script (UrlFetchApp), etc.. many more

More use cases:
  - node-gyp dependencies where there are c/c++ bindings
*/
module.exports = (request = hiddenRequire('request')) => {
  ...// do something with request and then some
}

Readme

Keywords

none

Package Sidebar

Install

npm i hidden-require

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

2.09 kB

Total Files

3

Last publish

Collaborators

  • nmccready