{"id":16731616,"url":"https://github.com/missinglink/netstat.js","last_synced_at":"2025-08-20T22:07:54.315Z","repository":{"id":8303649,"uuid":"9847297","full_name":"missinglink/netstat.js","owner":"missinglink","description":"nodejs binding for netstat, just in case you felt the need to see what your network is up to.","archived":false,"fork":false,"pushed_at":"2013-09-22T15:04:11.000Z","size":254,"stargazers_count":12,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T10:11:21.052Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/missinglink.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-04T00:40:44.000Z","updated_at":"2022-10-18T13:14:20.000Z","dependencies_parsed_at":"2022-08-07T02:01:12.567Z","dependency_job_id":null,"html_url":"https://github.com/missinglink/netstat.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missinglink%2Fnetstat.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missinglink%2Fnetstat.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missinglink%2Fnetstat.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missinglink%2Fnetstat.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/missinglink","download_url":"https://codeload.github.com/missinglink/netstat.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208612,"owners_count":21065203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T23:38:10.019Z","updated_at":"2025-04-10T11:23:56.147Z","avatar_url":"https://github.com/missinglink.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# netstat.js\n\n### A simple js wrapper for the netstat daemon.\n\nAllows you to output network statistics in real-time through stdout or via a socketio server.\n\n\nOutput is available in json or as raw stdout lines.\n\n---\n\n# Installing\n\n```bash\n$ npm install netstat --save\n```\n\nNote: you will need `node` and `npm` installed first.\n\nThe easiest way to install `node.js` is with [nave.sh](https://github.com/isaacs/nave) by executing `[sudo] ./nave.sh usemain 0.10`\n\nYou will need `netstat` installed, this is not a replacement for `netstat`; just a wrapper. On most unix-like systems it should be provided by default in the `net-tools` package.\n\n---\n\n# Getting data from netstat\n\n```javascript\nvar netstat = require('netstat');\n\nnetstat.on( 'stdout', function( data ){\n  process.stdout.write(\n    JSON.stringify( netstat.parse( data ), null, 2 ) + '\\n'\n  );\n});\n\nnetstat.on( 'stderr', function( err ) {\n  process.stderr.write( err );\n});\n```\n\nExample output:\n\n```bash\n[\n  {\n    \"Proto\": \"tcp\",\n    \"Recv-Q\": \"0\",\n    \"Send-Q\": \"0\",\n    \"Local-Address\": \"192.168.0.15:13887\",\n    \"Foreign-Address\": \"95.91.245.60:29101\",\n    \"State\": \"ESTABLISHED\",\n    \"User\": \"1000\",\n    \"Inode\": \"151487\",\n    \"PID/Program-name\": \"9738/spotify\"\n  },\n  {\n    \"Proto\": \"tcp\",\n    \"Recv-Q\": \"0\",\n    \"Send-Q\": \"0\",\n    \"Local-Address\": \"192.168.0.15:13887\",\n    \"Foreign-Address\": \"148.177.128.81:21404\",\n    \"State\": \"ESTABLISHED\",\n    \"User\": \"1000\",\n    \"Inode\": \"152049\",\n    \"PID/Program-name\": \"9738/spotify\"\n  }\n]\n```\n\n---\n\n# Binary version\n\nYou can install `netstatjs` globally by executing `[sudo] npm install -g netstat`\n\nIf you installed locally then you can execute it like this `./node_modules/netstat/bin/netstatjs --help`\n\nThe binary version has a few nice features like daemonizing \u0026 sending json stats to stdout or via socketio.\n\n```bash\npeter@edgy:/var/www$ netstatjs --help\n\n  Usage: netstatjs [options]\n\n  Options:\n\n    -h, --help             output usage information\n    -V, --version          output the version number\n    -s, --socketio [port]  bind socketio to port and stream stats in json\n    -j, --json [indent]    pipe json stats to stdout/stderr\n    -r, --raw              pipe raw stats to stdout/stderr\n\n```\n\n---\n\n# Examples\n\nMore examples can be found in `/bin/command/*`.\n\n# Status\n\nThis module is usable but not yet feature rich, netstat provides heaps more cool features that are not yet supported. Please star, fork and pull request if you find this useful.\n\n# License\n\n```javascript\nReleased under the MIT(Poetic) Software license\n\nThis work 'as-is' we provide.\nNo warranty express or implied.\nTherefore, no claim on us will abide.\nLiability for damages denied.\n\nPermission is granted hereby,\nto copy, share, and modify.\nUse as is fit,\nfree or for profit.\nThese rights, on this notice, rely.\n```\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/missinglink/netstat.js/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmissinglink%2Fnetstat.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmissinglink%2Fnetstat.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmissinglink%2Fnetstat.js/lists"}