{"id":16173147,"url":"https://github.com/joeferner/node-shark","last_synced_at":"2025-07-24T14:03:48.701Z","repository":{"id":66588867,"uuid":"3113199","full_name":"joeferner/node-shark","owner":"joeferner","description":"Wrapper around libwireshark providing network packet dissection","archived":false,"fork":false,"pushed_at":"2016-03-14T20:09:31.000Z","size":140,"stargazers_count":72,"open_issues_count":4,"forks_count":12,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-28T13:18:45.591Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joeferner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-01-05T20:53:40.000Z","updated_at":"2024-02-23T19:56:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"6addf20c-5a25-4537-aae0-7fee4408d474","html_url":"https://github.com/joeferner/node-shark","commit_stats":{"total_commits":73,"total_committers":4,"mean_commits":18.25,"dds":0.0821917808219178,"last_synced_commit":"88309cad7369781096b552eb36e1cdca2471bb42"},"previous_names":["nearinfinity/node-shark"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeferner%2Fnode-shark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeferner%2Fnode-shark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeferner%2Fnode-shark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeferner%2Fnode-shark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeferner","download_url":"https://codeload.github.com/joeferner/node-shark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955757,"owners_count":20374373,"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-10T04:06:43.698Z","updated_at":"2025-03-19T00:30:44.035Z","avatar_url":"https://github.com/joeferner.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nodeshark\n\nWrapper around libwireshark providing network packet dissection for [node.js](http://nodejs.org/).\n\n## Installation\n\n    $ npm install nodeshark\n\n### Build linux\n\n```bash\n$ git clone https://code.wireshark.org/review/wireshark\n$ cd wireshark\n$ ./autogen.sh\n$ ./configure\n$ make\n$ sudo make install\n$ export WIRESHARK_INCLUDE_DIR=[wireshark source directory]\n$ node-waf configure build\n```\n\n### Build OSX\n\n```bash\n$ git clone https://code.wireshark.org/review/wireshark\n$ cd wireshark\n$ ./macosx-setup.sh\n$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/X11/lib/pkgconfig\n$ ./autogen.sh\n$ ./configure\n$ make -j 3\n$ sudo make install\n\n$ export WIRESHARK_INCLUDE_DIR=[wireshark source directory]\n$ node-waf configure build\n```\n\n## Usage\n\n```javascript\nvar nodeshark = require(\"nodeshark\");\n\nvar dissector = new nodeshark.Dissector(nodeshark.LINK_LAYER_TYPE_ETHERNET);\n\nvar rawPacket = {\n  header: {\n    timestampSeconds: 10,\n    timestampMicroseconds: 20,\n    capturedLength: buffer.length,\n    originalLength: buffer.length\n  },\n  data: new Buffer([\n    0x58, 0x6d, 0x8f, 0x67, 0x8a, 0x4d, 0x00, 0x1b, 0x21, 0xcf, 0xa1, 0x00, 0x08, 0x00, 0x45, 0x00,\n    0x00, 0x3b, 0xd1, 0xb0, 0x40, 0x00, 0x40, 0x11, 0xc5, 0xde, 0x0a, 0x14, 0x08, 0x65, 0xc0, 0xa8,\n    0xd0, 0x01, 0xc5, 0x32, 0x00, 0x35, 0x00, 0x27, 0xa3, 0x5b, 0x65, 0x89, 0x01, 0x00, 0x00, 0x01,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x6d, 0x61, 0x69, 0x6c, 0x04, 0x6c, 0x69, 0x76, 0x65,\n    0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01\n  ]);\n};\nvar packet = dissector.dissect(rawPacket);\n\n// OR\n\nvar buffer = new Buffer([\n  0x58, 0x6d, 0x8f, 0x67, 0x8a, 0x4d, 0x00, 0x1b, 0x21, 0xcf, 0xa1, 0x00, 0x08, 0x00, 0x45, 0x00,\n  0x00, 0x3b, 0xd1, 0xb0, 0x40, 0x00, 0x40, 0x11, 0xc5, 0xde, 0x0a, 0x14, 0x08, 0x65, 0xc0, 0xa8,\n  0xd0, 0x01, 0xc5, 0x32, 0x00, 0x35, 0x00, 0x27, 0xa3, 0x5b, 0x65, 0x89, 0x01, 0x00, 0x00, 0x01,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x6d, 0x61, 0x69, 0x6c, 0x04, 0x6c, 0x69, 0x76, 0x65,\n  0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01\n]);\nvar packet = dissector.dissect(buffer);\n```\n\nYou can also use it it conjunction with [pcap-parser](https://github.com/nearinfinity/node-pcap-parser).\n\n```javascript\nvar pcapp = require('pcap-parser');\n\nvar parser = new pcapp.Parser('/path/to/file.pcap');\nvar dissector;\nparser.on('globalHeader', function(globalHeader) {\n  dissector = new nodeshark.Dissector(globalHeader.linkLayerType);\n});\nparser.on('packet', function(rawPacket) {\n  var packet = dissector.dissect(rawPacket);\n});\nparser.parse();\n```\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2012 Near Infinity Corporation\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeferner%2Fnode-shark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeferner%2Fnode-shark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeferner%2Fnode-shark/lists"}