1.0.1 • Published 9 years ago

require-internal v1.0.1

Weekly downloads
4
License
Unlicense
Repository
github
Last release
9 years ago

require-internal Build Status

Import a module, and expose its internals. Primarily intended for testing functions that would normally be hidden, but you can probably also do other kinds of hackery with it.

Note: the internals seem to be read only on v0.10.x. I'm not sure why; if you know, tell me!

Usage

Installation

npm install require-internal

Example

var ri = require('require-internal'),
    myModule = ri.require('./my-module'),
    myModuleInternals = ri.getInternals(myModule);

myModule.something === myModuleInternals.exports.something;
myModuleInternals.someHiddenFunction();

See the example/ folder for a bit more clarity.

License

Public domain, see license.txt for details.