{"_id":"@cto.af/pcap-ng-parser","_rev":"7-2c239fc812b33168ceed05c7032eb095","name":"@cto.af/pcap-ng-parser","dist-tags":{"latest":"3.0.2"},"versions":{"2.0.1":{"name":"@cto.af/pcap-ng-parser","version":"2.0.1","keywords":["pcap-ng","tcpdump","parser","network","packets","decode","draft-ietf-opsawg-pcapng"],"author":{"name":"Collinear Group","email":"support@collineargroup.com"},"license":"BSD-3","_id":"@cto.af/pcap-ng-parser@2.0.1","maintainers":[{"name":"hildjj","email":"joe-github@cursive.net"}],"contributors":[{"name":"George Barta"},{"name":"S. Everett Abbott"},{"name":"Joe Hildebrand","email":"joe-github@cursive.net"}],"homepage":"https://github.com/cto-af/pcap-ng-parser#readme","bugs":{"url":"https://github.com/cto-af/pcap-ng-parser/issues"},"dist":{"shasum":"83cb6f614d85bad8f8b72b78298029dcf3342ae9","tarball":"https://registry.npmjs.org/@cto.af/pcap-ng-parser/-/pcap-ng-parser-2.0.1.tgz","fileCount":9,"integrity":"sha512-v347BULw5yTaKFzNnuirdqdaDeox8iS5uwRnMJlQCZ0UXvyfe/LCDV1hKFF68rn7TD29vOhHDjhO+f13+uQUAw==","signatures":[{"sig":"MEUCIQDhHsomNWwjxGCOcPPF0BKYeCfYPyfvrv9ORbM4UhhJKgIgPM38bYwCO54NEkAfTc0uu34XMkzJ5bsafx9xwHfqi8c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59501},"main":"./src/PCAPNGParser.js","type":"module","types":"./types/PCAPNGParser.d.ts","engines":{"node":">=20"},"gitHead":"ee287c3953b27e7b279a7fa25cc0f04d19e1f10a","scripts":{"ts":"tsc","docs":"typedoc","lint":"eslint .","test":"c8 mocha","build":"npm run test && npm run ts && npm run lint && npm run docs","clean":"rimraf coverage doc types","example":"node examples/index.js"},"_npmUser":{"name":"hildjj","email":"joe-github@cursive.net"},"repository":{"url":"git+https://github.com/cto-af/pcap-ng-parser.git","type":"git"},"_npmVersion":"11.6.2","description":"Node.js Module for parsing .pcapng files and tcpdump output.","directories":{},"_nodeVersion":"24.10.0","dependencies":{"nofilter":"6.3.0","@leichtgewicht/ip-codec":"2.0.5"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.19.0","devDependencies":{"c8":"10.1.3","chai":"^6.2.0","mocha":"^11.7.4","eslint":"9.38.0","rimraf":"6.0.1","typedoc":"0.28.14","typescript":"5.9.3","@types/node":"24.9.1","ether-frame":"^0.2.0","@eslint/markdown":"7.5.0","eslint-plugin-jsdoc":"61.1.5","eslint-plugin-mocha":"11.2.0","@cto.af/eslint-config":"6.0.15"},"_npmOperationalInternal":{"tmp":"tmp/pcap-ng-parser_2.0.1_1761246920097_0.0060142944434669054","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@cto.af/pcap-ng-parser","version":"2.0.2","keywords":["pcap-ng","tcpdump","parser","network","packets","decode","draft-ietf-opsawg-pcapng"],"author":{"name":"Collinear Group","email":"support@collineargroup.com"},"license":"BSD-3","_id":"@cto.af/pcap-ng-parser@2.0.2","maintainers":[{"name":"hildjj","email":"joe-github@cursive.net"}],"contributors":[{"name":"George Barta"},{"name":"S. Everett Abbott"},{"name":"Joe Hildebrand","email":"joe-github@cursive.net"}],"homepage":"https://github.com/cto-af/pcap-ng-parser#readme","bugs":{"url":"https://github.com/cto-af/pcap-ng-parser/issues"},"dist":{"shasum":"2b36ec5e24437a1e5b0c97e16fff5b8ffe443901","tarball":"https://registry.npmjs.org/@cto.af/pcap-ng-parser/-/pcap-ng-parser-2.0.2.tgz","fileCount":9,"integrity":"sha512-aGav4OJJfarMEL7eKV4lkbIXF/U1lC9kDD2gsX63dR36c/gnuFIyBSHgQ2IVALJi1dMGkRKqYnT/gLMriQ3Stg==","signatures":[{"sig":"MEUCIB1+cMydKoKOz2bnnlpxQHjCapct5cniEsuGAhLyOcq9AiEAsCRmVNrh4shS8eCK9xpLMfrTUQPNCd5nY8P8DSBA4Uk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cto.af%2fpcap-ng-parser@2.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":58839},"main":"./src/PCAPNGParser.js","type":"module","types":"./types/PCAPNGParser.d.ts","engines":{"node":">=20"},"gitHead":"ff9e1a266dc8da3d5231215cdba9d1decc14b1fa","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:dea97ebd-a29b-42d3-9d49-f483025daaf3"}},"repository":{"url":"git+https://github.com/cto-af/pcap-ng-parser.git","type":"git"},"_npmVersion":"11.6.1","description":"Node.js Module for parsing .pcapng files and tcpdump output.","directories":{},"_nodeVersion":"24.10.0","dependencies":{"nofilter":"6.3.0","@leichtgewicht/ip-codec":"2.0.5"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.19.0","_npmOperationalInternal":{"tmp":"tmp/pcap-ng-parser_2.0.2_1761247397807_0.11283523287405428","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@cto.af/pcap-ng-parser","version":"2.0.3","keywords":["pcap-ng","tcpdump","parser","network","packets","decode","draft-ietf-opsawg-pcapng"],"author":{"name":"Collinear Group","email":"support@collineargroup.com"},"license":"BSD-3","_id":"@cto.af/pcap-ng-parser@2.0.3","maintainers":[{"name":"hildjj","email":"joe-github@cursive.net"}],"contributors":[{"name":"George Barta"},{"name":"S. Everett Abbott"},{"name":"Joe Hildebrand","email":"joe-github@cursive.net"}],"homepage":"https://github.com/cto-af/pcap-ng-parser#readme","bugs":{"url":"https://github.com/cto-af/pcap-ng-parser/issues"},"dist":{"shasum":"fea3e3edf6e3df28a73fb8542e1fa58506f78a1b","tarball":"https://registry.npmjs.org/@cto.af/pcap-ng-parser/-/pcap-ng-parser-2.0.3.tgz","fileCount":9,"integrity":"sha512-s9Q0TJNBI0nmtnthMZPNHf+U6w5xboMK4XICSPQjLFhLyo+831NOxUGQbtoZfBCA3J477TXvNtyqSI3u5VrwlA==","signatures":[{"sig":"MEUCIHxWzVSe7ew9+TKmHwKIcrA6esWA7OEiroFwyAhBm3gWAiEAsD7HaT+OdE44Yh9VjH4Q3yleYAM4d96aslYoyXsvibY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cto.af%2fpcap-ng-parser@2.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":58919},"main":"./src/PCAPNGParser.js","type":"module","types":"./types/PCAPNGParser.d.ts","engines":{"node":">=20"},"gitHead":"be94b3886536e44692965bf4f4d89658ef8b0df6","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:dea97ebd-a29b-42d3-9d49-f483025daaf3"}},"repository":{"url":"git+https://github.com/cto-af/pcap-ng-parser.git","type":"git"},"_npmVersion":"11.6.1","description":"Node.js Module for parsing .pcapng files and tcpdump output.","directories":{},"_nodeVersion":"24.10.0","dependencies":{"nofilter":"6.3.0","@leichtgewicht/ip-codec":"2.0.5"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.19.0","_npmOperationalInternal":{"tmp":"tmp/pcap-ng-parser_2.0.3_1761247792788_0.7318947294024798","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@cto.af/pcap-ng-parser","version":"2.1.0","keywords":["pcap-ng","tcpdump","parser","network","packets","decode","draft-ietf-opsawg-pcapng"],"author":{"name":"Collinear Group","email":"support@collineargroup.com"},"license":"BSD-3","_id":"@cto.af/pcap-ng-parser@2.1.0","maintainers":[{"name":"hildjj","email":"joe-github@cursive.net"}],"contributors":[{"name":"George Barta"},{"name":"S. Everett Abbott"},{"name":"Joe Hildebrand","email":"joe-github@cursive.net"}],"homepage":"https://github.com/cto-af/pcap-ng-parser#readme","bugs":{"url":"https://github.com/cto-af/pcap-ng-parser/issues"},"dist":{"shasum":"cff95ba0621a71754b022817aa7709eed09c21f4","tarball":"https://registry.npmjs.org/@cto.af/pcap-ng-parser/-/pcap-ng-parser-2.1.0.tgz","fileCount":11,"integrity":"sha512-uIsUcI1VKlhrWBnlnPyg1meqqieilHtZW7t9sEYN+p+9eW70MWxWdWfZmLrV4W3aWfWHiGl06duO1MQhFbxPmg==","signatures":[{"sig":"MEQCIBGdw0YMqHSf0CwC0nw1MIgLA87e5jJX4tyhgOViUYAqAiA6tpr9LUrFSDB184bX0QSz8pyUphwCpi8j83yyX5tjjQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cto.af%2fpcap-ng-parser@2.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":69996},"main":"./src/PCAPNGParser.js","type":"module","types":"./types/PCAPNGParser.d.ts","engines":{"node":">=20"},"gitHead":"63fa91f1c9c7e6ac4d2b091133c1683c7302b8b3","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:dea97ebd-a29b-42d3-9d49-f483025daaf3"}},"repository":{"url":"git+https://github.com/cto-af/pcap-ng-parser.git","type":"git"},"_npmVersion":"11.6.1","description":"Node.js Module for parsing .pcapng files and tcpdump output.","directories":{},"_nodeVersion":"24.11.0","dependencies":{"nofilter":"6.4.0","@leichtgewicht/ip-codec":"2.0.5"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.20.0","_npmOperationalInternal":{"tmp":"tmp/pcap-ng-parser_2.1.0_1762107084726_0.42831775154680196","host":"s3://npm-registry-packages-npm-production"}},"3.0.0":{"name":"@cto.af/pcap-ng-parser","version":"3.0.0","keywords":["pcap-ng","tcpdump","parser","network","packets","decode","draft-ietf-opsawg-pcapng"],"author":{"name":"Collinear Group","email":"support@collineargroup.com"},"license":"BSD-3","_id":"@cto.af/pcap-ng-parser@3.0.0","maintainers":[{"name":"hildjj","email":"joe-github@cursive.net"}],"contributors":[{"name":"George Barta"},{"name":"S. Everett Abbott"},{"name":"Joe Hildebrand","email":"joe-github@cursive.net"}],"homepage":"https://github.com/cto-af/pcap-ng-parser#readme","bugs":{"url":"https://github.com/cto-af/pcap-ng-parser/issues"},"dist":{"shasum":"12736df3d57b297247672f5c7740a8aee7326bee","tarball":"https://registry.npmjs.org/@cto.af/pcap-ng-parser/-/pcap-ng-parser-3.0.0.tgz","fileCount":9,"integrity":"sha512-HZSfbqRZjRD+yyaRxgT/nANHd/MdeDp1ICqWRkCTBtVkrPidTCUaSS/oKx6m9n7h9yqfrq/1CckFFlJsK2ZDvw==","signatures":[{"sig":"MEYCIQD5bnMwygy7DrUSKm2XrvUKKUy9HNK343bB2scUtC+uPQIhAI4JSrG9ML4kVXWZKEDIBbJcIsTu4Rq5Er2i18olBCXm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cto.af%2fpcap-ng-parser@3.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":50758},"main":"./lib/index.mjs","type":"module","engines":{"node":">=20"},"gitHead":"521488ac1a22f4cbdb32fa9b076901003e23608c","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:dea97ebd-a29b-42d3-9d49-f483025daaf3"}},"repository":{"url":"git+https://github.com/cto-af/pcap-ng-parser.git","type":"git"},"_npmVersion":"11.6.2","description":"Node.js Module for parsing .pcapng files and tcpdump output.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@cto.af/utils":"1.3.6","dataview-stream":"^2.0.2","@leichtgewicht/ip-codec":"2.0.5"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.25.0","_npmOperationalInternal":{"tmp":"tmp/pcap-ng-parser_3.0.0_1765734950821_0.9274750305863442","host":"s3://npm-registry-packages-npm-production"}},"3.0.1":{"name":"@cto.af/pcap-ng-parser","version":"3.0.1","keywords":["pcap-ng","tcpdump","parser","network","packets","decode","draft-ietf-opsawg-pcapng"],"author":{"name":"Collinear Group","email":"support@collineargroup.com"},"license":"BSD-3","_id":"@cto.af/pcap-ng-parser@3.0.1","maintainers":[{"name":"hildjj","email":"joe-github@cursive.net"}],"contributors":[{"name":"George Barta"},{"name":"S. Everett Abbott"},{"name":"Joe Hildebrand","email":"joe-github@cursive.net"}],"homepage":"https://github.com/cto-af/pcap-ng-parser#readme","bugs":{"url":"https://github.com/cto-af/pcap-ng-parser/issues"},"dist":{"shasum":"f0e0c15c94319fd09efa9cace6af0d604d963ec1","tarball":"https://registry.npmjs.org/@cto.af/pcap-ng-parser/-/pcap-ng-parser-3.0.1.tgz","fileCount":12,"integrity":"sha512-oNeRb5u77/GozblHdpRgVga+PImM/bavY8ranC50vNA9ofNTB/oSTw9aOFOzyILR6g2afX1UHpkiQVgOXC4fwg==","signatures":[{"sig":"MEYCIQD+E0E4689VEoxw9pCnx8ArgPX35GeN+wrmcwCss3Ls4QIhAJaDfJFdXb/jr7bx/yI4t9xJAs9nsXuMjzxB2WbY9oKn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cto.af%2fpcap-ng-parser@3.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":37775},"main":"./lib/index.mjs","type":"module","engines":{"node":">=20"},"gitHead":"5163d7218b604c90db44f19f740c8ac7f4fd872f","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:dea97ebd-a29b-42d3-9d49-f483025daaf3"}},"repository":{"url":"git+https://github.com/cto-af/pcap-ng-parser.git","type":"git"},"_npmVersion":"11.6.2","description":"Node.js Module for parsing .pcapng files and tcpdump output.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@cto.af/utils":"1.3.6","dataview-stream":"^2.0.2","@leichtgewicht/ip-codec":"2.0.5"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.25.0","_npmOperationalInternal":{"tmp":"tmp/pcap-ng-parser_3.0.1_1765735631697_0.8006394876675684","host":"s3://npm-registry-packages-npm-production"}},"3.0.2":{"name":"@cto.af/pcap-ng-parser","version":"3.0.2","description":"Node.js Module for parsing .pcapng files and tcpdump output.","main":"./lib/index.mjs","type":"module","repository":{"type":"git","url":"git+https://github.com/cto-af/pcap-ng-parser.git"},"keywords":["pcap-ng","tcpdump","parser","network","packets","decode","draft-ietf-opsawg-pcapng"],"author":{"name":"Collinear Group","email":"support@collineargroup.com"},"contributors":[{"name":"George Barta"},{"name":"S. Everett Abbott"},{"name":"Joe Hildebrand","email":"joe-github@cursive.net"}],"license":"BSD-3","dependencies":{"@cto.af/utils":"1.4.2","@leichtgewicht/ip-codec":"2.0.5","dataview-stream":"^2.0.3"},"packageManager":"pnpm@10.31.0","engines":{"node":">=20"},"gitHead":"8dbd6261e8f18da9ed153d7fd7a6c0b9893a4323","_id":"@cto.af/pcap-ng-parser@3.0.2","bugs":{"url":"https://github.com/cto-af/pcap-ng-parser/issues"},"homepage":"https://github.com/cto-af/pcap-ng-parser#readme","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-BsBAl38OEd+/4ZDjO6MGaE4PHAuUl4XVstmZslZJ4HLgnEk/zTAXCgYjze2AcUOyZFS93Ey/jNOSp6fq3v4X7A==","shasum":"d1a6e477e4368d1660bd2dccd31a40c4364b03f2","tarball":"https://registry.npmjs.org/@cto.af/pcap-ng-parser/-/pcap-ng-parser-3.0.2.tgz","fileCount":12,"unpackedSize":37308,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cto.af%2fpcap-ng-parser@3.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCKZdaL9akRZdo1hKWaZwQj1/tqK3KU4TIMBES3auz8TQIhANr+cNqmheLnPio6MkwBfbh4VcmkjzpMMWpHUZ/FzG1B"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:dea97ebd-a29b-42d3-9d49-f483025daaf3"}},"directories":{},"maintainers":[{"name":"hildjj","email":"joe-github@cursive.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pcap-ng-parser_3.0.2_1772994802022_0.6098728097204793"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-23T19:15:19.999Z","modified":"2026-03-08T18:33:22.500Z","2.0.1":"2025-10-23T19:15:20.296Z","2.0.2":"2025-10-23T19:23:18.009Z","2.0.3":"2025-10-23T19:29:53.016Z","2.1.0":"2025-11-02T18:11:24.932Z","3.0.0":"2025-12-14T17:55:50.966Z","3.0.1":"2025-12-14T18:07:11.836Z","3.0.2":"2026-03-08T18:33:22.193Z"},"bugs":{"url":"https://github.com/cto-af/pcap-ng-parser/issues"},"author":{"name":"Collinear Group","email":"support@collineargroup.com"},"license":"BSD-3","homepage":"https://github.com/cto-af/pcap-ng-parser#readme","keywords":["pcap-ng","tcpdump","parser","network","packets","decode","draft-ietf-opsawg-pcapng"],"repository":{"type":"git","url":"git+https://github.com/cto-af/pcap-ng-parser.git"},"description":"Node.js Module for parsing .pcapng files and tcpdump output.","contributors":[{"name":"George Barta"},{"name":"S. Everett Abbott"},{"name":"Joe Hildebrand","email":"joe-github@cursive.net"}],"maintainers":[{"name":"hildjj","email":"joe-github@cursive.net"}],"readme":"\n# Overview\n@cto.af/pcap-ng-parser is a stream-based module to decode, print and analyze\nnetwork traffic packets. With this module, you can read from an existing\n.pcap or .pcapng file or connect it to an active stream.\n\nImplements:\n- [draft-ietf-opsawg-pcap-06](https://www.ietf.org/archive/id/draft-ietf-opsawg-pcap-06.html)\n- [draft-ietf-opsawg-pcapng-04](https://www.ietf.org/archive/id/draft-ietf-opsawg-pcapng-04.html)\n\n# Installation\n\nThis module is available through the [npm registry](https://www.npmjs.com/).\n\n```bash\n$ npm install @cto.af/pcap-ng-parser\n```\n\n# Usage\n\nNote that the package on its own should work just fine in any modern JS\nruntime (including browsers).  However, reading from a file requires some\nruntime-dependent code.\n\n## Via .pcapng File for Node.js\nHere is a quick example of how to log out packets to the console from a valid .pcapng file named `myfile.pcapng`.\n\n```javascript\nimport {PCAPNGParser} from '@cto.af/pcap-ng-parser';\nimport fs from 'node:fs/promises';\nconst parser = new PCAPNGParser();\nconst file = await fs.open('examples/res/myfile.pcapng');\n\nparser\n  .on('data', parsedPacket => {\n    console.log(parsedPacket);\n  })\n  .on('interface', interfaceInfo => {\n    console.log(interfaceInfo);\n  });\nfile.readableWebStream().pipeTo(parser);\n```\n\nIn the example above, we create a new ReadableStream from our file and pipe to\nthe instance `parser` which will cause various events to fire.\n\n## Via .pcapng file in Deno\n\n```js\nimport {PCAPNGParser} from '@cto.af/pcap-ng-parser';\nconst pcapNgParser = new PCAPNGParser();\n\npcapNgParser\n  .on('data', parsedPacket => {\n    console.log(parsedPacket);\n  });\n\nconst f = await Deno.open('examples/res/myfile.pcapng');\nf.readable.pipeTo(pcapNgParser);\n```\n\n## Via .pcapng file in Bun\n\n```js\nimport {PCAPNGParser} from './src/index.ts';\nconst pcapNgParser = new PCAPNGParser();\n\npcapNgParser\n  .on('data', parsedPacket => {\n    console.log(parsedPacket);\n  })\n  .on('interface', interfaceInfo => {\n    console.log(interfaceInfo);\n  });\n\nconst f = Bun.file('examples/res/myfile.pcapng');\nf.stream().pipeTo(pcapNgParser);\n```\n\n## Via TCPDump in Node.JS\n\nYou can also pipe from TCPDump using `process.stdin` for a command line interaction.\n\n```javascript\nimport {PCAPNGParser} from '@cto.af/pcap-ng-parser';\nimport {Readable} from 'node:stream';\nconst pcapNgParser = new PCAPNGParser();\n\npcapNgParser\n  .on('data', parsedPacket => {\n    console.log(parsedPacket);\n  })\n  .on('interface', interfaceInfo => {\n    console.log(interfaceInfo);\n  });\n\nReadable.toWeb(process.stdin).pipeTo(pcapNgParser);\n```\n\n```bash\n$ sudo tcpdump -w - | node exampleAbove.js\n```\n\nNote that in order to utilize tcpdump you must be a superuser. Refer to [tcpdump documentation](http://www.tcpdump.org/manpages/tcpdump.1.html) for details.\n\nFurther note: If you specify an interface to listen on with \"-i\", tcpdump on some systems uses the old PCAP format, which PCAPNGParser will read just fine.\n\n## Other Examples\n\nAdditional examples can be found in the [examples directory](/examples/).\n\nIt allows you to read from a sample capture file (the default), a file (if you\nspecify a file name on the command line), or stdin (if you specify \"-\" as the\ninput file).\n\n# Class PCAPNGParser\n\nPCAPNGParser is an extension of the [stream.Transform\nclass](https://nodejs.org/api/stream.html#stream_class_stream_transform). The\nPCAPNGParser class fires the following events:\n\n- `data`: An Enhanced Packet or Simple block was parsed.\n- `section`: A Section Header block was parsed.\n- `interface`: An Interface block was parsed.\n- `names`: A Name Resolution block was parsed.\n- `secrets`: A Decryption Secrets block was parsed.\n- `stats`: An Interface Statistics block was parsed.\n- `custom`: A Custom block was parsed.\n- `blockType`: An unknown block type has been received.\n\nSee the full [API documentation](https://cto-af.github.io/pcap-ng-parser/) for\nthe types of the event parameters.\n\n# Contribution\n\nRefer to the the [Contribution Guide](/docs/CONTRIBUTING.md) for details on how to contribute.\n\n# License\n\nThis module is covered under the BSD-3 Open Software License. Review the [License Documention](/docs/LICENSE.md) for more information.\n\n# Provenance\n\nThis code was forked from https://github.com/CollinearGroup/pcap-ng-parser due\nto lack of maintenance.  To simplify matters, copyright remains with the\noriginal authors, including all changes made in this repository.  If the\noriginal authors contact me (easiest would be to file an issue here), all of\nthis can be changed in any way that suits them.\n\nThe following things have been added:\n\n- Fixed critical RangeError bug\n- Made 'end' and 'finish' events fire correctly by removing broken _finish code.  Note that you have to add an event for 'data' to get these events or 'close'\n  to fire, as with all Node Transform streams.\n- Converted to ES6 (BREAKING)\n- Added TypeScript types\n- Brought dependencies up to date\n- Added linting in @cto.af house style (to make maintenance easier)\n- Added test coverage\n- Renamed 'master' branch to 'main'\n- Added Github Actions for testing and publishing\n- Fixed broken links in readme and code\n- Fixed issues with padding for options\n- Now reads all options for supported block types, giving them names when known\n- Fixed issues with reading unexpected sizes in input stream\n- Added support for AbortSignals\n- Added support for multiple Section Header blocks in a stream, including\n  changes of endian-ness.\n- Added support for Simple Packet blocks.\n- Added support for Name Resolution blocks.\n- Added support for Interface Statistics blocks.\n- Added initial Support for Decryption Secrets blocks.\n- Added support for Custom blocks.\n- Added Enhanced Packet flag decoding.\n- Added converting timestamps to JS Dates.  Does not handle timezones yet. (BREAKING)\n- Added generate API documentation.\n- Added implementation of old .pcap format, with auto-detection.\n- Added decoding of linkType names.\n- Switched to web streams and Uint8Array, for portability.  (BREAKING)\n\n[![Tests](https://github.com/cto-af/pcap-ng-parser/actions/workflows/node.js.yml/badge.svg)](https://github.com/cto-af/pcap-ng-parser/actions/workflows/node.js.yml)\n[![codecov](https://codecov.io/gh/cto-af/pcap-ng-parser/graph/badge.svg?token=Akjw67WYcn)](https://codecov.io/gh/cto-af/pcap-ng-parser)\n","readmeFilename":"README.md"}