Neatly Punctuated Musings
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    required-aspublic

    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;

    Keywords

    none

    install

    npm i required-as

    Downloadsweekly downloads

    4

    version

    0.0.0

    license

    none

    last publish

    collaborators

    • avatar