require() for the browser - works with npm modules, browserify modules, components, expose objects and more


Just f**ing require modules and share code with the browser.

var f = require('frequire')(require)

Loads and registers a module file, or pass some code to be required (it will be wrapped like: module.exports = code)

Inserts window['some'] = code

Wraps and executes function: (fn)()

Returns a Connect middleware.

For now the only option is the pathname to match with req.url (defaults to /wrapped.js)

express-expose, browserify, brequire

Uses browser require impl. by TJ Holowaychuk