{"name":"process-top","version":"1.4.0","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"process-top@1.4.0","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"homepage":"https://github.com/mafintosh/process-top","bugs":{"url":"https://github.com/mafintosh/process-top/issues"},"bin":{"process-top":"bin.js"},"dist":{"shasum":"3538dce6c13d95362eccb0b475c6e5e5dc7dd8fb","tarball":"http://registry-npm.ywwl.com/process-top/download/process-top-1.4.0.tgz","fileCount":7,"integrity":"sha512-vF+STvcWdo7zgKWsupK9eg6waq8dNSBYGe3KCDvt12kGzpPeuwMYWCFAZsCYj145LPiOJxn/e/TZZ4l4hpavAA==","signatures":[{"sig":"MEYCIQCaiHvPATQcMomXsOqNmRqSsD/1W8R46FDTytMI1lwngAIhAKnqwBHw9QGzAuxK8Zqx9p9J4mh4fbnccp12j/kBi2Zq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8024,"size":3352,"noattachment":false,"key":"/process-top/-/process-top-1.4.0.tgz"},"main":"index.js","gitHead":"fd82d9eb9ccb6aa227f8345a92f40c306acce67d","imports":{"os":{"bare":"bare-os","default":"os"},"./hrtime":{"bare":"bare-hrtime","default":"./hrtime.js"}},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"repository":{"url":"git+https://github.com/mafintosh/process-top.git","type":"git"},"_npmVersion":"10.9.0","description":"A \"top\" like module for your Node.js process. Collects CPU usage etc.","directories":{},"_nodeVersion":"22.12.0","dependencies":{"bare-os":"^3.1.0","bare-hrtime":"^2.0.10","prettier-bytes":"^1.0.4","event-loop-delay":"^1.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/process-top_1.4.0_1743073316532_0.4442302767183042","host":"s3://npm-registry-packages-npm-production"},"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":1743073316703,"_cnpm_publish_time":1743073316703,"dist-tags":{"latest":"1.8.0"}}