node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

requirefresh

Require Fresh

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
Slack community badge Patreon donate button Gratipay donate button Flattr donate button PayPal donate button Bitcoin donate button Wishlist browse button

Require a file without adding it into the require cache

Install

NPM

  • Install: npm install --save requirefresh
  • Module: require('requirefresh')
  • Browserify

    • Install: npm install --save requirefresh
    • Module: require('requirefresh')
    • CDN URL: //wzrd.in/bundle/requirefresh@2.1.0
    • Ender

      • Install: ender add requirefresh
      • Module: require('requirefresh')
      • Editions

        This package is published with the following editions:

        • requirefresh aliases requirefresh/index.js which uses Editions to automatically select the correct edition for the consumers environment
        • requirefresh/source/index.js is Source + ESNext + Require
        • requirefresh/es2015/index.js is Babel Compiled + ES2015 + Require

        Older environments may need Babel's Polyfill or something similar.

        Usage

        // Import 
        var requireFresh = require('requirefresh')
         
        // Require the module freshly synchronously (will throw errors) 
        try {
            var result = requireFresh('my-module-path')
        } catch (error) {}
         
        // Require the fresh module synchronously (will callback with error and result) 
        requireFresh.safe('my-module-path', function(error, result){
            if (error) {
                // error 
            } else {
                // success 
            }
        })

        History

        Discover the release history by heading on over to the HISTORY.md file.

        Contribute

        Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

        Backers

        Maintainers

        These amazing people are maintaining this project:

        Sponsors

        No sponsors yet! Will you be the first?

        Patreon donate button Gratipay donate button Flattr donate button PayPal donate button Bitcoin donate button Wishlist browse button

        Contributors

        These amazing people have contributed code to this project:

        Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

        License

        Unless stated otherwise all works are:

        and licensed under: