{"_id":"process-top","_rev":"391396","name":"process-top","description":"A \"top\" like module for your Node.js process. Collects CPU usage etc.","dist-tags":{"latest":"1.2.0"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2021-08-04T03:54:15.000Z","created":"2019-01-03T12:25:37.289Z","1.2.0":"2020-11-03T12:49:42.634Z","1.1.0":"2020-05-27T14:10:42.380Z","1.0.0":"2019-01-03T12:25:37.289Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/process-top.git"},"versions":{"1.2.0":{"name":"process-top","version":"1.2.0","description":"A \"top\" like module for your Node.js process. Collects CPU usage etc.","main":"index.js","dependencies":{"event-loop-delay":"^1.0.0","prettier-bytes":"^1.0.4"},"devDependencies":{},"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":"17eb13abe1905d65dbe670ea22eb99a7aeb3b1c5","_id":"process-top@1.2.0","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"shasum":"0443a7b2c61b0aae1207fa5562cb23252df986b6","size":2984,"noattachment":false,"key":"/process-top/-/process-top-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-top/download/process-top-1.2.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/process-top_1.2.0_1604407782481_0.7935135270433413"},"_hasShrinkwrap":false,"publish_time":1604407782634,"_cnpm_publish_time":1604407782634},"1.1.0":{"name":"process-top","version":"1.1.0","description":"A \"top\" like module for your Node.js process. Collects CPU usage etc.","main":"index.js","dependencies":{"event-loop-delay":"^1.0.0","prettier-bytes":"^1.0.4"},"devDependencies":{},"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":"174a0c897e2a0c25da51fbd57450ea2fc4b70ac3","_id":"process-top@1.1.0","_nodeVersion":"12.17.0","_npmVersion":"6.14.4","dist":{"shasum":"beb66f815dc9f6e091906a2590a3255ffa145f5b","size":2943,"noattachment":false,"key":"/process-top/-/process-top-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-top/download/process-top-1.1.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/process-top_1.1.0_1590588642213_0.7662765782666436"},"_hasShrinkwrap":false,"publish_time":1590588642380,"_cnpm_publish_time":1590588642380},"1.0.0":{"name":"process-top","version":"1.0.0","description":"A \"top\" like module for your Node.js process. Collects CPU usage etc.","main":"index.js","dependencies":{"event-loop-delay":"^1.0.0","prettier-bytes":"^1.0.4"},"devDependencies":{},"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":"9c6966cbef27bb3953dbc0adfcd0f802b3d26f1a","_id":"process-top@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"52892bedb581c5abf0df2d0aa5c429e34275cc7e","size":2859,"noattachment":false,"key":"/process-top/-/process-top-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/process-top/download/process-top-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/process-top_1.0.0_1546518337137_0.021351619135726807"},"_hasShrinkwrap":false,"publish_time":1546518337289,"_cnpm_publish_time":1546518337289}},"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","_attachments":{},"homepage":"https://github.com/mafintosh/process-top","bugs":{"url":"https://github.com/mafintosh/process-top/issues"},"license":"MIT"}