require-internal

1.0.1 • Public • Published

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.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i require-internal

      Weekly Downloads

      0

      Version

      1.0.1

      License

      Unlicense

      Last publish

      Collaborators

      • shz