You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

require-list

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-list

require tree list

0.1.8
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Require List

Required children tree.

Installation

npm install -g require-list

Usage

Command

rlist [javascript file path in entry-point]

Example

/tmp/a.js

var b = require('./b');
var test = require('./test');

/tmp/b.js

require('./test/c');
module.exports = 'b';

/tmp/test/index.js

require('./c');

/tmp/test/c.js

module.exports = function() { return 'c' };
$ rlist /tmp/a.js
/tmp/a.js
   ├── b.js
   |   └── test/c.js
   └── test/index.js
       └── test/c.js

Module API

Example

var rlist = require('require-list');

console.log('rlist(filepath)');
console.log(rlist('/tmp/a.js'));

console.log('rlist.string(filepath)');
console.log(rlist.string('/tmp/a.js'));

// --output--
// rlist(filepath)
// { '/tmp/b.js': { '/tmp/test/c.js': {} },
//  '/tmp/test/index.js': { '/tmp/test/c.js': {} } } }

// rlist.string(filepath)
// /tmp/a.js
//    ├── b.js
//    |   └── test/c.js
//    └── test/index.js
//        └── test/c.js

Contribution

  • Fork it ( https://github.com/iyu/require-list/fork )
  • Create a feature branch
  • Commit your changes
  • Rebase your local changes against the master branch
  • Run test suite with the npm test; npm run jshint command and confirm that it passes
  • Create new Pull Request

Keywords

require

FAQs

Package last updated on 29 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.