{"name":"process-top","version":"1.8.0","description":"A \"top\" like module for your Node.js process. Collects CPU usage etc.","main":"index.js","imports":{"./hrtime":{"bare":"bare-hrtime","default":"./hrtime.js"},"os":{"bare":"bare-os","default":"os"}},"dependencies":{"bare-hrtime":"^2.0.10","bare-os":"^3.1.0","event-loop-delay":"^1.1.0","tiny-byte-size":"^1.1.0"},"bin":{"process-top":"bin.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/process-top.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/process-top/issues"},"homepage":"https://github.com/mafintosh/process-top","gitHead":"e9348e145d8fc0b4c8a900953b782f4ee6ed2013","_id":"process-top@1.8.0","_nodeVersion":"24.13.0","_npmVersion":"11.15.0","dist":{"integrity":"sha512-jO6OowYVnGkBP4DRW52Y/ALyYbJIT55UpSSNq/hjszluc37/k9CpQnzVZTX1sKNw+Xzrae9f9zPBFZwEaSx0YQ==","shasum":"e200fde9aad68fe6cdeb3c86ad1fc50620a2c67a","tarball":"http://registry-npm.ywwl.com/process-top/download/process-top-1.8.0.tgz","fileCount":7,"unpackedSize":8278,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDPDm3vVl4FEALfGGd92kerk4na5l8B5pKnGcutp5R+EwIhAOFKLUTU7NQaKDgU5by4Q2Ibsd+9fjJsPJ14nfEiaRIS"}],"size":3432,"noattachment":false,"key":"/process-top/-/process-top-1.8.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/process-top_1.8.0_1787073670028_0.13348909648135732"},"_hasShrinkwrap":false,"readme":"# process-top\n\nA \"top\" like module for your Node.js process. Collects CPU usage etc.\n\n```\nnpm install process-top\n```\n\n## Usage\n\n``` js\nconst top = require('process-top')()\n\nsetInterval(function () {\n  // Prints out a string containing stats about your Node.js process.\n  console.log(top.toString())\n}, 1000)\n```\n\nRunning the above will print something similar to:\n\n```\ncpu: 0.4% | rss: 32 MB (0.2%) | heap: 5.1 MB / 8.1 MB (63.5%) | ext: 8.8 KB | delay: 0 ms | 00:00:52 | loadavg: 0.52, 0.37, 0.31\n```\n\n* `cpu` is cpu usage by the process in the last ~5s.\n* `rss` is how much `rss` memory Node has allocated out of your total memory.\n* `heap` is how much heap you are using vs total heap.\n* `ext` is how much external memory Node.js is using (ie, Buffers etc).\n* `delay` is event loop delay the last ~5s.\n* `00:00:00` is the runtime of the process\n* `loadavg` is the current loadavg of the machine.\n\n## API\n\n#### `top = processTop()`\n\nCreate a new process top object.\n\n#### `top.cpu()`\n\nReturns a CPU stats object.\n\n#### `top.memory()`\n\nReturns a memory stats object.\n\n#### `top.delay()`\n\nReturns the event loop delay.\n\n#### `top.runtime()`\n\nReturns the runtime in ms.\n\n#### `top.loadavg()`\n\nReturns the load average of the machine.\n\n#### `top.toString()`\n\nReturns a human friendly string representation of the top object.\n\n#### `top.destroy()`\n\nDestroy the top object.\n\n#### `top.toJSON()`\n\nReturn the stats as JSON.\n\n## CLI\n\nThere is also a CLI tool available.\n\n```\nnpm install -g process-top\nprocess-top my-cool-program.js\n```\n\nThe CLI will print a `top.toString()` line every 1s the program is running.\n\n## License\n\nMIT\n","publish_time":1787073670176,"_cnpm_publish_time":1787073670176,"dist-tags":{"latest":"1.8.0"}}