{"_id":"@0x5278/wiretap","name":"@0x5278/wiretap","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@0x5278/wiretap","version":"0.1.0","description":"Low-level Node networking toolkit. Raw TCP/UDP, HTTP/1.1, instances, structured logging. No dependencies.","main":"main.js","scripts":{"validate":"node -e \"['package.json'].forEach(f => JSON.parse(require('fs').readFileSync(f,'utf8'))); console.log('ok')\"","test":"node --test"},"keywords":["networking","tcp","udp","http","socks","tor","proxy","low-level"],"author":{"name":"Joey Koch","url":"@0x5278"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/JoeyKoch1/wiretap.git"},"bugs":{"url":"https://github.com/JoeyKoch1/wiretap/issues"},"homepage":"https://github.com/JoeyKoch1/wiretap#readme","engines":{"node":">=18"},"_id":"@0x5278/wiretap@0.1.0","gitHead":"e873b56f10e0a87db2144690d066d54ec8e7b5a5","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-P/87iI1qlcys5iTWrq16H2Cj/R8zUU4DH5ZNNf2066306E18i5HH5VXdTSYEOVki5EJG518YisCMX9JhFZTAdQ==","shasum":"e03a1baf9680657dfcce9587453430bd41610599","tarball":"https://registry.npmjs.org/@0x5278/wiretap/-/wiretap-0.1.0.tgz","fileCount":9,"unpackedSize":22368,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@0x5278%2fwiretap@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDqgyl+mnWBQxFKQochWQl2XQ0BoNxakP1utvSzswzL2AiEAkFK4FDxm9n8hY7OA86rLvmD3p+O0YR88J7kcPs7+bDQ="}]},"_npmUser":{"name":"0x5278","email":"joeykoch2010@gmail.com"},"directories":{},"maintainers":[{"name":"0x5278","email":"joeykoch2010@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wiretap_0.1.0_1787158764039_0.5803049591081395"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-19T16:59:23.890Z","0.1.0":"2026-08-19T16:59:24.184Z","modified":"2026-08-19T16:59:24.668Z"},"maintainers":[{"name":"0x5278","email":"joeykoch2010@gmail.com"}],"description":"Low-level Node networking toolkit. Raw TCP/UDP, HTTP/1.1, instances, structured logging. No dependencies.","homepage":"https://github.com/JoeyKoch1/wiretap#readme","keywords":["networking","tcp","udp","http","socks","tor","proxy","low-level"],"repository":{"type":"git","url":"git+https://github.com/JoeyKoch1/wiretap.git"},"author":{"name":"Joey Koch","url":"@0x5278"},"bugs":{"url":"https://github.com/JoeyKoch1/wiretap/issues"},"license":"MIT","readme":"# wiretap\n\n[![npm version](https://img.shields.io/npm/v/@0x5278/wiretap)](https://www.npmjs.com/package/@0x5278/wiretap)\n[![license](https://img.shields.io/npm/l/@0x5278/wiretap)](LICENSE)\n[![node engine](https://img.shields.io/node/v/@0x5278/wiretap)](package.json)\n[![CI](https://img.shields.io/github/actions/workflow/status/JoeyKoch1/wiretap/ci.yml?branch=main)](https://github.com/JoeyKoch1/wiretap/actions)\n\nLow-level Node networking toolkit. Raw TCP and UDP, an HTTP/1.1 client, named instances and structured logging. Zero dependencies, just the Node core (`net`, `tls`, `dgram`, `http`, `zlib`).\n\nHigh-level clients like axios, got and fetch hide the parts of the stack that matter when you care about the wire. wiretap keeps them visible: header order, raw sockets, timeouts you control. SOCKS, Tor and identity management are next; the plan is in [docs/ROADMAP.md](docs/ROADMAP.md).\n\n## Install\n\n```sh\nnpm install @0x5278/wiretap\n```\n\n## Quick start\n\n```js\nconst wiretap = require('@0x5278/wiretap');\n\n// an instance carries headers and a named log scope\nconst api = wiretap.wiretap({\n  name: 'api',\n  headers: { 'x-api-key': 'secret' },\n});\n\nconst res = await api.get('https://api.example.com/data');\nconsole.log(res.status, res.body.toString());\n\n// stateless client when you do not want instance semantics\nconst { HttpClient } = wiretap;\nconst res2 = await new HttpClient().post('https://api.example.com/thing', { a: 1 });\n```\n\nResponses resolve for any status code. Transport failures reject, with `code` set (`ECONNREFUSED`, `ETIMEDOUT`, `ABORT_ERR`).\n\n## Low level\n\n```js\nconst { TcpSocket, UdpSocket } = require('@0x5278/wiretap');\n\nconst sock = new TcpSocket({ host: 'example.com', port: 80, idleTimeout: 30000 });\nsock.on('data', (chunk) => console.log(chunk.toString()));\nawait sock.connect();\nsock.write('GET / HTTP/1.1\\r\\nHost: example.com\\r\\n\\r\\n');\n```\n\nTLS sockets work the same way, pass `tls` options to the constructor for a custom CA, SNI override or stricter verification.\n\n## API\n\n| export | what it is |\n| --- | --- |\n| `wiretap(options)` | named instance factory, merges headers, exposes request helpers |\n| `HttpClient` | stateless HTTP/1.1 client with redirects, gzip/br, abort |\n| `TcpSocket` | raw TCP with optional TLS, connect and idle timeouts |\n| `UdpSocket` | raw UDP send and receive |\n| `createLogger` | structured JSON logs, secret redaction on by default |\n| `createInstance` | what `wiretap()` calls, exported if you want it directly |\n\nHTTP request options: `url`, `method`, `headers` (object or flat `[k, v, ...]` array to preserve order), `body` (string, Buffer, stream, or object which becomes JSON), `timeout`, `redirects`, `decompress`, `signal` (AbortController).\n\n## Docs\n\n- [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md): layer layout and where modules land\n- [docs/ROADMAP.md](docs/ROADMAP.md): what ships when\n- [CONTRIBUTING.md](CONTRIBUTING.md): how to help\n\n## License\n\nMIT, see [LICENSE](LICENSE).","readmeFilename":"README.md","_rev":"1-22fd44e9d770416b00991564777d46f3"}