{"_id":"@angius/bun-returning-rewriter","_rev":"3-e6ca54c66f4bc0511b33a978580aaf14","name":"@angius/bun-returning-rewriter","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@angius/bun-returning-rewriter","version":"1.0.0","keywords":["bun","rewriter","typescript","parser","html"],"author":"Angius","license":"MIT","_id":"@angius/bun-returning-rewriter@1.0.0","maintainers":[{"name":"angius","email":"koumarin@gmail.com"}],"homepage":"https://github.com/Atulin/bun-returning-rewriter#readme","bugs":{"url":"https://github.com/Atulin/bun-returning-rewriter/issues"},"dist":{"shasum":"7daac0ad04f34bebe74ae0a3a8f0103fd48e265c","tarball":"https://registry.npmjs.org/@angius/bun-returning-rewriter/-/bun-returning-rewriter-1.0.0.tgz","fileCount":4,"integrity":"sha512-m1umoI2/ay5whY+92cMscg7jxOxo/hhxcngIvEmM2jWsT4PKX8CFiGxMYxp+nyQObTAovPE3BqR5YGsr+7MK1Q==","signatures":[{"sig":"MEUCIQCtwnxa95hZHuW37/mB/5zDOdolxtep/FgCGCGnbkFTZgIgcNaOxpI5uHa5KPL+xyesyZyn1KybGpivnwrOP3yIdMo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3437},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"7daac0ad04f34bebe74ae0a3a8f0103fd48e265c","scripts":{"lint":"bunx @biomejs/biome check --apply-unsafe .","build":"bun run build:ts","format":"bunx @biomejs/biome format --write .","build:ts":"bun build ./index.ts --outdir ./dist --target bun --dts"},"_npmUser":{"name":"angius","email":"koumarin@gmail.com"},"_integrity":"sha512-m1umoI2/ay5whY+92cMscg7jxOxo/hhxcngIvEmM2jWsT4PKX8CFiGxMYxp+nyQObTAovPE3BqR5YGsr+7MK1Q==","repository":{"url":"git+https://github.com/Atulin/bun-returning-rewriter.git","type":"git"},"_npmVersion":"10.8.3","description":"A thin wrapper over HtmlRewriter providing support for returning data","directories":{},"_nodeVersion":"22.6.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@biomejs/biome":"1.9.4"},"peerDependencies":{"bun":"^1.2","typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/bun-returning-rewriter_1.0.0_1747865549181_0.45740666938223207","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@angius/bun-returning-rewriter","version":"1.0.1","keywords":["bun","rewriter","typescript","parser","html"],"author":{"name":"Angius"},"license":"MIT","_id":"@angius/bun-returning-rewriter@1.0.1","maintainers":[{"name":"angius","email":"koumarin@gmail.com"}],"homepage":"https://github.com/Atulin/bun-returning-rewriter#readme","bugs":{"url":"https://github.com/Atulin/bun-returning-rewriter/issues"},"dist":{"shasum":"0eeefe0651817de53916d703f70db253efc555e9","tarball":"https://registry.npmjs.org/@angius/bun-returning-rewriter/-/bun-returning-rewriter-1.0.1.tgz","fileCount":4,"integrity":"sha512-8cRZ/7bue/1CX+ZlcTDb6pdwteEBOj3sqMtI32PUdDCcREKSNCsqpGkPsTakcGq2dZfT+qVTPf53znxDBCt6MA==","signatures":[{"sig":"MEUCIC0eVg48N6e2vMnqi0yrcpkkiJVYpU7TeTQLZd/kebGZAiEA0jLQfjhu/QUuy2nGR4XzrisuDboVFQ2A8/aoStyBkN4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4300},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","gitHead":"a1ae8a7d85c5fc13e90e61455c13281a33e4568e","scripts":{"lint":"bunx @biomejs/biome check --apply-unsafe .","build":"bun run build:ts","format":"bunx @biomejs/biome format --write .","build:ts":"bun build ./index.ts --outdir ./dist --target bun --dts"},"_npmUser":{"name":"angius","email":"koumarin@gmail.com"},"repository":{"url":"git+https://github.com/Atulin/bun-returning-rewriter.git","type":"git"},"_npmVersion":"10.9.2","description":"A thin wrapper over HtmlRewriter providing support for returning data","directories":{},"_nodeVersion":"22.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@biomejs/biome":"1.9.4"},"peerDependencies":{"bun":"^1.2","typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/bun-returning-rewriter_1.0.1_1747867594034_0.7532889221991683","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@angius/bun-returning-rewriter","version":"1.0.2","description":"A thin wrapper over HtmlRewriter providing support for returning data","keywords":["bun","rewriter","typescript","parser","html"],"homepage":"https://github.com/Atulin/bun-returning-rewriter#readme","bugs":{"url":"https://github.com/Atulin/bun-returning-rewriter/issues"},"repository":{"type":"git","url":"git+https://github.com/Atulin/bun-returning-rewriter.git"},"license":"MIT","author":{"name":"Angius"},"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","publishConfig":{"access":"public"},"scripts":{"build":"bun ./build.ts","lint":"bunx @biomejs/biome check --apply-unsafe .","format":"bunx @biomejs/biome format --write ."},"devDependencies":{"@biomejs/biome":"1.9.4","@types/bun":"latest","bun-plugin-isolated-decl":"^0.2.4"},"peerDependencies":{"typescript":"^5","bun":"^1.2"},"_id":"@angius/bun-returning-rewriter@1.0.2","gitHead":"ed5aa634e55dec733c191b15bba1a9363a283873","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-tqvRaT8f2iMiOf/FPGc3Hm7c7VH5y4lt6PGj7fS0J60/qPhyJUbeqztQsETba+2n5C4vpOZaYnw9SBqKGlz/aA==","shasum":"2150c548960658a774fdfcc4aa625425ed8bed54","tarball":"https://registry.npmjs.org/@angius/bun-returning-rewriter/-/bun-returning-rewriter-1.0.2.tgz","fileCount":5,"unpackedSize":5645,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCNzukYNMjpdKZl0xjeTp816eZ/e7yeLEvkiacfVO/euQIhAKbH/oUhZWd4LqBCrItFRlgEf2in92TjNTPfvPGNHZgR"}]},"_npmUser":{"name":"angius","email":"koumarin@gmail.com"},"directories":{},"maintainers":[{"name":"angius","email":"koumarin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bun-returning-rewriter_1.0.2_1747868423031_0.45832671957960724"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-21T22:12:29.113Z","modified":"2025-05-21T23:00:23.394Z","1.0.0":"2025-05-21T22:12:29.371Z","1.0.1":"2025-05-21T22:46:34.204Z","1.0.2":"2025-05-21T23:00:23.211Z"},"bugs":{"url":"https://github.com/Atulin/bun-returning-rewriter/issues"},"author":{"name":"Angius"},"license":"MIT","homepage":"https://github.com/Atulin/bun-returning-rewriter#readme","keywords":["bun","rewriter","typescript","parser","html"],"repository":{"type":"git","url":"git+https://github.com/Atulin/bun-returning-rewriter.git"},"description":"A thin wrapper over HtmlRewriter providing support for returning data","maintainers":[{"name":"angius","email":"koumarin@gmail.com"}],"readme":"# Bun Returning Rewriter\n\n[![JSR Version](https://img.shields.io/jsr/v/%40angius/bun-returning-rewriter?style=for-the-badge&color=f7df1e)](https://jsr.io/@angius/bun-returning-rewriter)\n[![NPM Version](https://img.shields.io/npm/v/%40angius%2Fbun-returning-rewriter?style=for-the-badge&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40angius%2Fbun-returning-rewriter)](https://www.npmjs.com/package/@angius/bun-returning-rewriter)\n[![GitHub License](https://img.shields.io/github/license/atulin/bun-returning-rewriter?style=for-the-badge&color=darkgreen)](./LICENSE.txt)\n![Bun Badge](https://img.shields.io/badge/Bun-fbf0df?style=for-the-badge&logo=bun&logoSize=auto&labelColor=333&color=fbf0df)\n\nA thin wrapper over HtmlRewriter providing support for returning data\n\n## Install\n\n```sh\nbunx jsr add @angius/bun-returning-rewriter\n```\n\nor\n\n```sh\nbun add @angius/bun-returning-rewriter\n```\n\n## Usage\n\n```ts\nconst html = `\n    <div data-foo=\"one\"></div>\n    <div data-foo=\"two\"></div>\n`;\n\nconst rewriter = new ReturningHtmlRewriter();\nrewriter.on('div[data-foo]', {\n    element(el, ctx) {\n        ctx.add({\n            name: el.tagName,\n            foo: el.getAttribute('data-foo')\n        })\n    }\n});\nconst data = rewriter.parse(html);\nconsole.log(JSON.stringify(data, null, 4));\n/*\n[\n    {\n        \"name\": \"div\",\n        \"foo\": \"one\"\n    },\n    {\n        \"name\": \"div\",\n        \"foo\": \"two\"\n    }\n]\n*/\n```\n","readmeFilename":"README.md"}