required-as
v0.0.0
Published
Get a list of require()'d modules in a javascript module along with the names in module scope the module objects are assigned to.
Downloads
3
Readme
Get the names and paths of modules required in a given module:
> var required_as = require('./lib/required-as');
undefined
> required_as('tests/fixtures/module.js');
[ { name: 'net', source: 'net' },
{ name: 'self', source: './module.js' },
{ name: 'required_as',
source: '../../lib/required-as.js' } ]
from the module:
var net = require('net');
var self = require('./module.js');
var required_as = require('../../lib/required-as.js');
var not_a_module = 3;