{"id":20372617,"url":"https://github.com/txchen/p-by-p","last_synced_at":"2025-09-21T01:33:27.234Z","repository":{"id":57317384,"uuid":"122674754","full_name":"txchen/p-by-p","owner":"txchen","description":"Packet-By-Packet, a pcap reader inspired by line-by-line and pcap-reader","archived":false,"fork":false,"pushed_at":"2018-02-24T21:54:34.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T04:46:36.156Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/txchen.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}},"created_at":"2018-02-23T21:30:43.000Z","updated_at":"2022-03-02T02:15:23.000Z","dependencies_parsed_at":"2022-08-25T21:11:35.507Z","dependency_job_id":null,"html_url":"https://github.com/txchen/p-by-p","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/txchen%2Fp-by-p","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Fp-by-p/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Fp-by-p/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Fp-by-p/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/txchen","download_url":"https://codeload.github.com/txchen/p-by-p/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241921840,"owners_count":20042763,"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-11-15T01:14:05.442Z","updated_at":"2025-09-21T01:33:22.121Z","avatar_url":"https://github.com/txchen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# p-by-p\n\nPacket-By-Packet, a pcap reader inspired by line-by-line and pcap-reader\n\n## Installation\n\n```bash\nnpm install p-by-p\n```\n\n## Usage\n\n```js\nconst PacketByPacket = require('p-by-p')\nconst readline = require('readline')\n\nconst pbyp = PacketByPacket('/path/to/file.pcap')\n// setup event handler\npbyp.on('globalHeader', gh =\u003e {\n  // process pcap file global header\n})\npbyp.on('packet', p =\u003e {\n  // process your packet data\n\n  // you can also stop/resume the reader\n  pbyp.pause()\n  const rl = readline.createInterface({\n    input: process.stdin,\n    output: process.stdout\n  })\n  rl.question(`Do you want to resume?`, (answer) =\u003e {\n    pbyp.resume()\n    rl.close()\n  })\n})\npbyp.on('end', () =\u003e {\n  // no more data\n})\npbyp.on('error', err =\u003e {})\n// start it\npbyp.resume()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxchen%2Fp-by-p","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftxchen%2Fp-by-p","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxchen%2Fp-by-p/lists"}