Skip to content

shz/node-require-internal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Test non-exported functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published