2.0.5 • Published 5 years ago
require-so-slow v2.0.5
require-so-slow
- Wondering why your applications is slow to start?
requireseems to take an eternity?- Wonder no more!
This module produces a timeline of your requires and produces an output
that you can load in the Chrome Timeline Viewer.
Click on the image above to go see an interactive version.
Command Line Usage
# Profiles the timeline of requiring `request@latest` and generates a trace
# output file you can load in Chrome Timeline viewer [1]
$ npx require-so-slow request
# You can specify specific versions or dist-tags.
$ npx require-so-slow got@9.0.0
$ npx require-so-slow got@rc
# You can specify what output filename to use:
$ npm require-so-slow -o lodash.trace.json lodashYou can also preload require-so-slow from node:
npm i -D require-so-slow
# Traces the entire execution of entrypoint and writes to
# ./require-so-slow.trace by default
$ node -r require-so-slow [entrypoint]
# The output path can be changed with the TRACE_OUTFILE environent variableAPI
const requireSoSlow = require('require-so-slow');
// load stuff, run stuff.
require('request');
// Write a trace file at some point.
requireSoSlow.write('require-trace.trace');