How to use the proxyquire.proxy function in proxyquire

To help you get started, we’ve selected a few proxyquire examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thlorenz / proxyquireify / example / bundle.mod.js View on Github external
function(require, module, exports){

          // added via transform ---->
          var require_ = require;
          require = require('proxyquire').proxy(require_);
          // <----

          var bar = require('./bar');

          module.exports = function () {
            return + ' ist ' + bar.wunder();

      , {"./bar":'bar'}


Proxies nodejs require in order to allow overriding dependencies during testing.

Latest version published 5 years ago

Package Health Score

74 / 100
Full package analysis