{"name":"process-top","version":"1.7.0","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"process-top@1.7.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":"3b0dc8675780b676f79f84d6c0edb333edf40069","tarball":"http://registry-npm.ywwl.com/process-top/download/process-top-1.7.0.tgz","fileCount":7,"integrity":"sha512-CDuhUEF2CFT7pYgLOk3UwHwj7yRsSV2dLuZrjK/vANRLcWkbDrwamUhDKYmU3kFEF/7115nwbjNkVjXFHAdoyw==","signatures":[{"sig":"MEUCIQC4GCcxCE+T9eRPERpGcdpOH7QTjACy970V21W6iiXwrwIgNpKdZctIYJDTtTE7GK91nTLH84sPuMiP2tYkDaC8kO4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8258,"size":3432,"noattachment":false,"key":"/process-top/-/process-top-1.7.0.tgz"},"main":"index.js","gitHead":"abd39e6d043ce0c002a6ac0a738de5b0c196cc70","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.2","description":"A \"top\" like module for your Node.js process. Collects CPU usage etc.","directories":{},"_nodeVersion":"22.16.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.7.0_1763720703470_0.3905809583888473","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":1763720703674,"_cnpm_publish_time":1763720703674,"dist-tags":{"latest":"1.8.0"}}