{"_id":"@maxbrunsfeld/flame-graph","_rev":"4251558","name":"@maxbrunsfeld/flame-graph","description":"Profile a process or command and produce a flame graph","dist-tags":{"latest":"0.1.9"},"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"}],"time":{"modified":"2026-03-31T23:45:41.000Z","created":"2017-12-23T22:42:31.191Z","0.1.9":"2018-03-07T02:54:42.713Z","0.1.8":"2018-03-06T01:27:01.821Z","0.1.7":"2017-12-27T22:32:47.413Z","0.1.6":"2017-12-26T21:25:42.425Z","0.1.5":"2017-12-26T18:13:10.733Z","0.1.4":"2017-12-25T22:12:23.946Z","0.1.3":"2017-12-25T07:27:59.261Z","0.1.2":"2017-12-25T00:54:31.597Z","0.1.1":"2017-12-24T08:46:37.490Z","0.1.0":"2017-12-23T22:42:31.191Z"},"users":{},"author":{"name":"Max Brunsfeld"},"versions":{"0.1.9":{"name":"@maxbrunsfeld/flame-graph","version":"0.1.9","description":"Profile a process or command and produce a flame graph","main":"src/generate-flame-graph.js","bin":{"generate-flame-graph":"./bin/generate-flame-graph"},"scripts":{"test":"mocha"},"author":{"name":"Max Brunsfeld"},"license":"MIT","devDependencies":{"mocha":"^4.0.1"},"dependencies":{"dedent":"^0.7.0","minimist":"^1.2.0","temp":"^0.8.3"},"gitHead":"72b183a7db52db667eea446dad55e6c6ed3dda05","_id":"@maxbrunsfeld/flame-graph@0.1.9","_npmVersion":"5.7.1","_nodeVersion":"8.4.0","_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"dist":{"shasum":"cda7f836eb3eb0c8c6fcac69d1b4dae86b671d20","size":90436,"noattachment":false,"key":"/@maxbrunsfeld/flame-graph/-/@maxbrunsfeld/flame-graph-0.1.9.tgz","tarball":"http://registry.cnpm.dingdandao.com/@maxbrunsfeld/flame-graph/download/@maxbrunsfeld/flame-graph-0.1.9.tgz"},"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flame-graph_0.1.9_1520391282512_0.34532497662545225"},"_hasShrinkwrap":false,"publish_time":1520391282713,"_cnpm_publish_time":1520391282713,"_cnpmcore_publish_time":"2021-12-16T20:00:01.417Z"},"0.1.8":{"name":"@maxbrunsfeld/flame-graph","version":"0.1.8","description":"Profile a process or command and produce a flame graph","main":"src/generate-flame-graph.js","bin":{"generate-flame-graph":"./bin/generate-flame-graph"},"scripts":{"test":"mocha"},"author":{"name":"Max Brunsfeld"},"license":"MIT","devDependencies":{"mocha":"^4.0.1"},"dependencies":{"dedent":"^0.7.0","minimist":"^1.2.0","temp":"^0.8.3"},"gitHead":"690acdff421f42d6bb00b79db795832bc2dc40fe","_id":"@maxbrunsfeld/flame-graph@0.1.8","_npmVersion":"5.7.1","_nodeVersion":"8.4.0","_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"dist":{"shasum":"dcb91d8501a2c6707aa5cc74c99ebcff8ef96714","size":90416,"noattachment":false,"key":"/@maxbrunsfeld/flame-graph/-/@maxbrunsfeld/flame-graph-0.1.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/@maxbrunsfeld/flame-graph/download/@maxbrunsfeld/flame-graph-0.1.8.tgz"},"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flame-graph_0.1.8_1520299621016_0.22345042006046856"},"_hasShrinkwrap":false,"publish_time":1520299621821,"_cnpm_publish_time":1520299621821,"_cnpmcore_publish_time":"2021-12-16T20:00:01.962Z"},"0.1.7":{"name":"@maxbrunsfeld/flame-graph","version":"0.1.7","description":"Profile a process or command and produce a flame graph","main":"src/generate-flame-graph.js","bin":{"generate-flame-graph":"./bin/generate-flame-graph"},"scripts":{"test":"mocha"},"author":{"name":"Max Brunsfeld"},"license":"MIT","devDependencies":{"mocha":"^4.0.1"},"dependencies":{"dedent":"^0.7.0","temp":"^0.8.3","yargs":"^10.0.3"},"gitHead":"cc6228ec5217b13108f419ed634f71b232d7c132","_id":"@maxbrunsfeld/flame-graph@0.1.7","_npmVersion":"5.6.0","_nodeVersion":"8.4.0","_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"dist":{"shasum":"4efd5d2b240c099dbc80cfb5f7375c3adaf1d3c9","size":3075,"noattachment":false,"key":"/@maxbrunsfeld/flame-graph/-/@maxbrunsfeld/flame-graph-0.1.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/@maxbrunsfeld/flame-graph/download/@maxbrunsfeld/flame-graph-0.1.7.tgz"},"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flame-graph-0.1.7.tgz_1514413966507_0.6759049592074007"},"directories":{},"publish_time":1514413967413,"_hasShrinkwrap":false,"_cnpm_publish_time":1514413967413,"_cnpmcore_publish_time":"2021-12-16T20:00:02.195Z"},"0.1.6":{"name":"@maxbrunsfeld/flame-graph","version":"0.1.6","description":"Profile a process or command and produce a flame graph","main":"src/generate-flame-graph.js","bin":{"generate-flame-graph":"./bin/generate-flame-graph"},"scripts":{"test":"mocha"},"author":{"name":"Max Brunsfeld"},"license":"MIT","devDependencies":{"mocha":"^4.0.1"},"dependencies":{"dedent":"^0.7.0","temp":"^0.8.3","yargs":"^10.0.3"},"gitHead":"1cf4bf82c64172a0cd2a08257c751b99c946d9e5","_id":"@maxbrunsfeld/flame-graph@0.1.6","_npmVersion":"5.6.0","_nodeVersion":"8.4.0","_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"dist":{"shasum":"c9f984310dccc8d1f795a4e701288e965bb3bc54","size":3001,"noattachment":false,"key":"/@maxbrunsfeld/flame-graph/-/@maxbrunsfeld/flame-graph-0.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/@maxbrunsfeld/flame-graph/download/@maxbrunsfeld/flame-graph-0.1.6.tgz"},"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flame-graph-0.1.6.tgz_1514323542328_0.4733124002814293"},"directories":{},"publish_time":1514323542425,"_hasShrinkwrap":false,"_cnpm_publish_time":1514323542425,"_cnpmcore_publish_time":"2021-12-16T20:00:02.487Z"},"0.1.5":{"name":"@maxbrunsfeld/flame-graph","version":"0.1.5","description":"Profile a process or command and produce a flame graph","main":"src/generate-flame-graph.js","bin":{"generate-flame-graph":"./bin/generate-flame-graph"},"scripts":{"test":"mocha"},"author":{"name":"Max Brunsfeld"},"license":"MIT","devDependencies":{"mocha":"^4.0.1"},"dependencies":{"dedent":"^0.7.0","temp":"^0.8.3","yargs":"^10.0.3"},"gitHead":"f8222ea83651c788cb3e510c98c74fa45f870e7c","_id":"@maxbrunsfeld/flame-graph@0.1.5","_npmVersion":"5.6.0","_nodeVersion":"8.4.0","_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"dist":{"shasum":"46856dd9e51e128050f26ede8003bac85a952826","size":3023,"noattachment":false,"key":"/@maxbrunsfeld/flame-graph/-/@maxbrunsfeld/flame-graph-0.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/@maxbrunsfeld/flame-graph/download/@maxbrunsfeld/flame-graph-0.1.5.tgz"},"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flame-graph-0.1.5.tgz_1514311989819_0.12315688049420714"},"directories":{},"publish_time":1514311990733,"_hasShrinkwrap":false,"_cnpm_publish_time":1514311990733,"_cnpmcore_publish_time":"2021-12-16T20:00:02.755Z"},"0.1.4":{"name":"@maxbrunsfeld/flame-graph","version":"0.1.4","description":"Profile a process or command and produce a flame graph","main":"src/generate-flame-graph.js","bin":{"generate-flame-graph":"./bin/generate-flame-graph"},"scripts":{"test":"mocha"},"author":{"name":"Max Brunsfeld"},"license":"MIT","devDependencies":{"mocha":"^4.0.1"},"dependencies":{"dedent":"^0.7.0","temp":"^0.8.3","yargs":"^10.0.3"},"gitHead":"54cd955261c5e0df02542d0f9075a8ccb1a7a298","_id":"@maxbrunsfeld/flame-graph@0.1.4","_npmVersion":"5.6.0","_nodeVersion":"8.4.0","_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"dist":{"shasum":"8598bf8808ca26dc817e8d6492c9ccdec779bf77","size":2995,"noattachment":false,"key":"/@maxbrunsfeld/flame-graph/-/@maxbrunsfeld/flame-graph-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/@maxbrunsfeld/flame-graph/download/@maxbrunsfeld/flame-graph-0.1.4.tgz"},"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flame-graph-0.1.4.tgz_1514239943824_0.24806881579570472"},"directories":{},"publish_time":1514239943946,"_hasShrinkwrap":false,"_cnpm_publish_time":1514239943946,"_cnpmcore_publish_time":"2021-12-16T20:00:03.043Z"},"0.1.3":{"name":"@maxbrunsfeld/flame-graph","version":"0.1.3","description":"Profile a process or command and produce a flame graph","main":"src/generate-flame-graph.js","bin":{"generate-flame-graph":"./bin/generate-flame-graph"},"scripts":{"test":"mocha"},"author":{"name":"Max Brunsfeld"},"license":"MIT","devDependencies":{"mocha":"^4.0.1"},"dependencies":{"dedent":"^0.7.0","temp":"^0.8.3","yargs":"^10.0.3"},"gitHead":"6816514ee4d55b14fad183e20ddfbfce9a196c97","_id":"@maxbrunsfeld/flame-graph@0.1.3","_npmVersion":"5.6.0","_nodeVersion":"8.4.0","_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"dist":{"shasum":"8bb63b16f8d279ae481551f2dbfecd4fbd839114","size":2999,"noattachment":false,"key":"/@maxbrunsfeld/flame-graph/-/@maxbrunsfeld/flame-graph-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@maxbrunsfeld/flame-graph/download/@maxbrunsfeld/flame-graph-0.1.3.tgz"},"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flame-graph-0.1.3.tgz_1514186879183_0.5149637886788696"},"directories":{},"publish_time":1514186879261,"_hasShrinkwrap":false,"_cnpm_publish_time":1514186879261,"_cnpmcore_publish_time":"2021-12-16T20:00:03.494Z"},"0.1.2":{"name":"@maxbrunsfeld/flame-graph","version":"0.1.2","description":"Profile a process or command and produce a flame graph","main":"src/generate-flame-graph.js","bin":{"generate-flame-graph":"./bin/generate-flame-graph"},"scripts":{"test":"mocha"},"author":{"name":"Max Brunsfeld"},"license":"MIT","devDependencies":{"mocha":"^4.0.1"},"dependencies":{"dedent":"^0.7.0","temp":"^0.8.3","yargs":"^10.0.3"},"gitHead":"65815d04e1d3f75eaecfa90f59611dafc9000281","_id":"@maxbrunsfeld/flame-graph@0.1.2","_npmVersion":"5.6.0","_nodeVersion":"8.4.0","_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"dist":{"shasum":"6104bbc9c929ae6d63b8c906b2c3db56621df670","size":3024,"noattachment":false,"key":"/@maxbrunsfeld/flame-graph/-/@maxbrunsfeld/flame-graph-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@maxbrunsfeld/flame-graph/download/@maxbrunsfeld/flame-graph-0.1.2.tgz"},"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flame-graph-0.1.2.tgz_1514163271451_0.409764782525599"},"directories":{},"publish_time":1514163271597,"_hasShrinkwrap":false,"_cnpm_publish_time":1514163271597,"_cnpmcore_publish_time":"2021-12-16T20:00:03.876Z"},"0.1.1":{"name":"@maxbrunsfeld/flame-graph","version":"0.1.1","description":"Profile a process or command and produce a flame graph","main":"src/generate-flame-graph.js","bin":{"generate-flame-graph":"./bin/generate-flame-graph"},"scripts":{"test":"mocha"},"author":{"name":"Max Brunsfeld"},"license":"MIT","devDependencies":{"mocha":"^4.0.1"},"dependencies":{"dedent":"^0.7.0","temp":"^0.8.3","yargs":"^10.0.3"},"gitHead":"2ea3acca219bc115c0abf5eaef7abc4208ec2b03","_id":"@maxbrunsfeld/flame-graph@0.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.4.0","_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"dist":{"shasum":"20eff8675de8eaa285368618f8da0f39116d1d35","size":2839,"noattachment":false,"key":"/@maxbrunsfeld/flame-graph/-/@maxbrunsfeld/flame-graph-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@maxbrunsfeld/flame-graph/download/@maxbrunsfeld/flame-graph-0.1.1.tgz"},"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flame-graph-0.1.1.tgz_1514105197430_0.612110945628956"},"directories":{},"_cnpmcore_publish_time":"2021-12-23T05:35:25.084Z","publish_time":1514105197490,"_cnpm_publish_time":1514105197490},"0.1.0":{"name":"@maxbrunsfeld/flame-graph","version":"0.1.0","description":"Profile a process or command and produce a flame graph","main":"src/generate-flame-graph.js","bin":{"generate-flame-graph":"./bin/generate-flame-graph"},"scripts":{"test":"mocha"},"author":{"name":"Max Brunsfeld"},"license":"MIT","devDependencies":{"mocha":"^4.0.1"},"dependencies":{"dedent":"^0.7.0","temp":"^0.8.3","yargs":"^10.0.3"},"gitHead":"f5005fc0dfb8ccd0315af4f570f7c43aeb39b63b","_id":"@maxbrunsfeld/flame-graph@0.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.4.0","_npmUser":{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},"dist":{"shasum":"97c4e893b92dd5962fd4691a85ceb8e27343519e","size":2667,"noattachment":false,"key":"/@maxbrunsfeld/flame-graph/-/@maxbrunsfeld/flame-graph-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@maxbrunsfeld/flame-graph/download/@maxbrunsfeld/flame-graph-0.1.0.tgz"},"maintainers":[{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flame-graph-0.1.0.tgz_1514068951119_0.5314387145917863"},"directories":{},"_cnpmcore_publish_time":"2021-12-23T05:35:23.456Z","publish_time":1514068951191,"_cnpm_publish_time":1514068951191}},"readme":"flame-graph\n===========\n\n[![Build Status](https://travis-ci.org/maxbrunsfeld/node-flame-graph.svg?branch=master)](https://travis-ci.org/maxbrunsfeld/node-flame-graph)\n\nThis library makes it easy to profile a process with [`dtrace`](https://en.wikipedia.org/wiki/DTrace) on macOS and to format the results as a [Flame Graph](https://queue.acm.org/detail.cfm?id=2927301).\n\n![flame graph example](./doc/flame-graph-example.png)\n\nTo use this tool within [Atom](https://atom.io), try the [flame-graph](https://github.com/maxbrunsfeld/atom-flame-graph) Atom package.\n\n## Installation\n\n```sh\nnpm install @maxbrunsfeld/flame-graph\n```\n\n## Command Line Usage\n\nTo profile a running process:\n\n```sh\n$ generate-flame-graph -p $PID_TO_PROFILE\n```\n\nTo stop profiling, kill the process with <kbd>Control</kbd>+<kbd>C</kbd>.\n\nTo create and profile a child process with a given command:\n\n```sh\n$ generate-flame-graph -c './test arg1 arg2'\n```\n\nOften, you're only interested in profiling a certain function (or functions). You can do this using the optional `-f`/`--functions` flag:\n\n```sh\n$ generate-flame-graph -p $PID --functions 'function1 function2'\n```\n\n## Programmatic Usage\n\nAll of the functionality shown above is accessible programatically.\n\n```js\nconst {\n  generateFlameGraphForCommand,\n  generateFlameGraphForProcess\n} = require('@maxbrunsfeld/flame-graph')\n\nasync function test1 () {\n  // Create and profile a child process\n  console.log(await generateFlameGraphForCommand(\n    './test arg1 arg2'\n    {\n      functionNames: ['function1', 'function2']\n    }\n  ))\n\n  // Profile a running process\n  const flameGraph = generateFlameGraphForProcess(\n    pidToProfile,\n    {\n      functionNames: ['function1', 'function2']\n    }\n  )\n\n  setTimeout(() => flameGraph.stop(), 100)\n  console.log(await flameGraph.html)\n}\n```\n","_attachments":{},"license":"MIT"}