{"name":"process-top","version":"1.5.1","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"process-top@1.5.1","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":"f3e618a269a6e4bd4ed26a8ce9f70314ff19b96f","tarball":"http://registry-npm.ywwl.com/process-top/download/process-top-1.5.1.tgz","fileCount":7,"integrity":"sha512-morXk3XB9kUFX3Ll8gxK4fqOZlG2X/eRi5eYp3DNDK4IKjgvhNkKi13i7Ufw/VTxYLPBmjGO+Pw6A4KlS359Og==","signatures":[{"sig":"MEQCIEsQ1Yps2sC6T5Q9VxMk1N/WDBmeO0hOqWzOqFBuDOnYAiAtdY5Eyhc04pWnD5R3Z6y1ASzmLRlPr5BdG7XWT+aU6g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8150,"size":3408,"noattachment":false,"key":"/process-top/-/process-top-1.5.1.tgz"},"main":"index.js","gitHead":"6e752421a4f90122cc6a13074912339558995a34","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.5.1_1743146423247_0.9756216552020358","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":1743146423426,"_cnpm_publish_time":1743146423426,"dist-tags":{"latest":"1.8.0"}}