Jaguard / time-require

Displays the execution time for Node.js modules loading by hooking require() calls
MIT License
253 stars 20 forks source link

time-require @ Jaguard OSS 100% Built with gulp.js

Displays the execution time for Node.js modules loading by hooking and tracing all require() calls. This module was inspired by @sindresorhus's time-grunt.

Project status

Default usage (non-verbose) showing required modules in loaded order, above 1% treshold default

Verbose (all) & sorted usage showing all required modules in sorted order verbose-sorted

Install

Install with npm

npm install --save time-require

Usage

  1. Embeded usage, generally as first require() call in your main module.
    require("time-require");
  2. External usage with --require preload supported by Liftoff driven CLI modules like gulp.js or Grunt-Next
    gulp --require time-require --sorted
  3. If you're using gulp.js, use instead gulpt, a gulp CLI wrapper that automatically preload time-require.
    npm install -g gulpt
    gulpt build --sorted

Display layout

Modules loading that take less than 1% of the total time are hidden to reduce clutter. To show all the modules use the --verbose (or --V) flag on the running CLI. To sort the modules according to the loading time (longest on top) use the --sorted (or --s) flag on the running CLI.

Documentation

Detailed API documentation can be found in 'doc' folder.

Development

Detailed development documentation can be found in 'doc' folder.

License

MIT © Jaguard OSS

Changelog