🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

cli-profile

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-profile

profiling tool for CLI tools

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

cli-profile

cli-profile is a simple wrapper around v8-profiler, making it easy to use for CLI tools in node.

Usage

Invoke it as if it's node. For example, to profile an npm install:

$ cli-profile `which npm` install

All the arguments are passed to program you're profiling. This will then generate a timestamped .cpuprofile file in the current directory, which you can then load up into Chrome Dev Tools, or use flamegraph.

To generate a flamegraph from a cpu profile:

$ npm i -g flamegraph
$ cat *.cpuprofile | flamegraph -t cpuprofile > graph.svg

The profile will run from the time the program starts until either process.exit is called or the beforeExit event is emitted on process. This corresponds to the lifetime of the program being profiled.

License

MIT. See LICENSE.txt

Keywords

cli

FAQs

Package last updated on 29 Jan 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