{"_id":"@alessiofrittoli/stream-writer","_rev":"6-57e97986d6c2a128e3faea3d67e81b67","name":"@alessiofrittoli/stream-writer","dist-tags":{"latest":"1.4.0"},"versions":{"1.0.0":{"name":"@alessiofrittoli/stream-writer","version":"1.0.0","keywords":["stream","stream-writer","streaming"],"author":{"url":"https://alessiofrittoli.it","name":"Alessio Frittoli","email":"info@alessiofrittoli.it"},"license":"MIT","_id":"@alessiofrittoli/stream-writer@1.0.0","maintainers":[{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"}],"homepage":"https://github.com/alessiofrittoli/stream-writer#readme","bugs":{"url":"https://github.com/alessiofrittoli/stream-writer/issues","email":"info@alessiofrittoli.it"},"dist":{"shasum":"558b98bebd9d5f16bfad75d0d43f2aa75beded7e","tarball":"https://registry.npmjs.org/@alessiofrittoli/stream-writer/-/stream-writer-1.0.0.tgz","fileCount":7,"integrity":"sha512-hrn41w6OSXecpBeWkwiieRTJK+d3XM9B+gDEaWSASNApdPWtm6HpRwwG/9knR0b+mP+VIvYQQOsLF2tIXaunAQ==","signatures":[{"sig":"MEUCIHwTF0pc8zv8Q3BZsbxxklrAlxcG7C44WIkzsfWhtHmtAiEAhAsWRenhY9gocucsO9EJqSPi0QW2e7a/VVIFw6urDnY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22603},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"8f2532c8eb8ae50b96f2f056592d90b4390106ac","scripts":{"lint":"eslint","test":"jest","build":"pnpm lint && pnpm test:ci && pnpm test:ci:jsdom && tsup","release":"node scripts/publish.js --verbose --npm","test:ci":"jest --ci --verbose","test:jest":"pnpm test:watch jest.test.ts","test:jsdom":"JSDOM=true pnpm test:watch","test:watch":"jest --watchAll --verbose","build:watch":"tsup --watch","test:stream":"pnpm test:watch index.test.ts","test:ci:jsdom":"JSDOM=true pnpm test:ci","test:coverage":"pnpm test:watch --coverage","test:jest:jsdom":"JSDOM=true pnpm test:jest","test:ci:coverage":"pnpm test:ci --coverage","test:stream:jsdom":"JSDOM=true pnpm test:stream","test:coverage:jsdom":"JSDOM=true pnpm test:coverage","test:coverage:serve":"concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\"","test:serve-coverage":"http-server ./coverage/lcov-report --gzip true -p 0 -o --silent","test:coverage:jsdom:serve":"JSDOM=true pnpm test:coverage:serve"},"_npmUser":{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"},"repository":{"url":"git+https://github.com/alessiofrittoli/stream-writer.git","type":"git"},"_npmVersion":"10.9.0","description":"Easly push data to a Stream","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.3.5","dotenv":"^16.4.7","eslint":"^9.18.0","globals":"^15.14.0","ts-jest":"^29.2.5","ts-node":"^10.9.2","@eslint/js":"^9.18.0","typescript":"^5.7.3","@types/jest":"^29.5.14","@types/node":"^22.10.7","http-server":"^14.1.1","concurrently":"^9.1.2","@jest/globals":"^29.7.0","typescript-eslint":"^8.20.0","jest-environment-jsdom":"^29.7.0","@alessiofrittoli/node-scripts":"^2.2.1","@alessiofrittoli/stream-reader":"^1.3.0"},"_npmOperationalInternal":{"tmp":"tmp/stream-writer_1.0.0_1737203880712_0.5929603517335749","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@alessiofrittoli/stream-writer","version":"1.1.0","keywords":["stream","stream-writer","streaming"],"author":{"url":"https://alessiofrittoli.it","name":"Alessio Frittoli","email":"info@alessiofrittoli.it"},"license":"MIT","_id":"@alessiofrittoli/stream-writer@1.1.0","maintainers":[{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"}],"homepage":"https://github.com/alessiofrittoli/stream-writer#readme","bugs":{"url":"https://github.com/alessiofrittoli/stream-writer/issues","email":"info@alessiofrittoli.it"},"dist":{"shasum":"c9da525d88572bdb277274ed3b16308c0a7a2673","tarball":"https://registry.npmjs.org/@alessiofrittoli/stream-writer/-/stream-writer-1.1.0.tgz","fileCount":9,"integrity":"sha512-S2NRWUfUhgSXhd6iccexYXjwVgqLfL4VDRoyoBGkKSgHEdb5fOF/DFm9KlI9BncU7Sftl69A3pcpEJqMyrI+Yw==","signatures":[{"sig":"MEYCIQDDdw6A9SQqWopq7L5QbZUwi3kxhtsEJICSt2cbrcNnfAIhANxDgmw41oJ+ugfRE7gpKj1+LRik0/AscvMSJUEoIYtJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34860},"main":"./dist/index.js","pnpm":{"onlyBuiltDependencies":["esbuild"]},"types":"./dist/index.d.ts","module":"./dist/index.mjs","funding":[{"url":"https://github.com/sponsors/alessiofrittoli","type":"github"}],"gitHead":"202131477cd3469d891c078d4e35e003a3075c76","scripts":{"//1a":"*********************************************************************","//1b":"*********************** BUILD - LINT - RELEASE **********************","//1c":"*********************************************************************","//2a":"*********************************************************************","//2b":"***************************** UNIT TESTS ****************************","//2c":"*********************************************************************","//3a":"*********************************************************************","//3b":"************************ UNIT TESTS COVERAGE ************************","//3c":"*********************************************************************","//4a":"*********************************************************************","//4b":"************************ TARGETED UNIT TESTS ************************","//4c":"*********************************************************************","lint":"eslint","test":"jest --verbose","build":"pnpm lint && pnpm test:ci && pnpm test:ci:jsdom && tsup","release":"node scripts/publish.js --verbose --npm","test:ci":"jest --ci --verbose","test:jest":"pnpm test:watch jest.test.ts","test:jsdom":"JSDOM=true pnpm test:watch","test:watch":"jest --watchAll --verbose","build:watch":"tsup --watch","test:stream":"pnpm test:watch index.test.ts","test:ci:jsdom":"JSDOM=true pnpm test:ci","test:coverage":"pnpm test:watch --coverage","test:jest:jsdom":"JSDOM=true pnpm test:jest","test:ci:coverage":"pnpm test:ci --coverage","test:stream:jsdom":"JSDOM=true pnpm test:stream","test:coverage:jsdom":"JSDOM=true pnpm test:coverage","test:coverage:serve":"concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\"","test:serve-coverage":"http-server ./coverage/lcov-report --gzip true -p 0 -o --silent","test:coverage:jsdom:serve":"JSDOM=true pnpm test:coverage:serve"},"_npmUser":{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"},"repository":{"url":"git+https://github.com/alessiofrittoli/stream-writer.git","type":"git"},"_npmVersion":"10.9.0","description":"Easly push data to a Stream","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.4.0","dotenv":"^16.4.7","eslint":"^9.22.0","globals":"^16.0.0","ts-jest":"^29.2.6","ts-node":"^10.9.2","@eslint/js":"^9.22.0","typescript":"^5.8.2","@types/jest":"^29.5.14","@types/node":"^22.13.10","http-server":"^14.1.1","concurrently":"^9.1.2","@jest/globals":"^29.7.0","typescript-eslint":"^8.26.1","jest-environment-jsdom":"^29.7.0","@alessiofrittoli/node-scripts":"^2.3.0","@alessiofrittoli/stream-reader":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/stream-writer_1.1.0_1742400703392_0.6698976436441539","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@alessiofrittoli/stream-writer","version":"1.1.1","keywords":["stream","stream-writer","streaming"],"author":{"url":"https://alessiofrittoli.it","name":"Alessio Frittoli","email":"info@alessiofrittoli.it"},"license":"MIT","_id":"@alessiofrittoli/stream-writer@1.1.1","maintainers":[{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"}],"homepage":"https://github.com/alessiofrittoli/stream-writer#readme","bugs":{"url":"https://github.com/alessiofrittoli/stream-writer/issues","email":"info@alessiofrittoli.it"},"dist":{"shasum":"c9b60ef6eca4e636983fa9651f7db198775b3343","tarball":"https://registry.npmjs.org/@alessiofrittoli/stream-writer/-/stream-writer-1.1.1.tgz","fileCount":9,"integrity":"sha512-gKEP6GqJmzP9TsXzYJ2USMLj3EnDvaCdl2BubgNKSuwgwF+0U3FCLAVFoi0KV7npb3dfJK7zk+4+CvQtVQn7ZQ==","signatures":[{"sig":"MEUCIQDhu51s9qhttxH6I1h1tcCJ8Q2kxqfITFdnzEBoITrz/gIgZ/WtH3zXWBEjd3pta7Y7OJaXXSibwYz7Bd8HghR7vxs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35078},"main":"./dist/index.js","pnpm":{"onlyBuiltDependencies":["esbuild"]},"types":"./dist/index.d.ts","module":"./dist/index.mjs","funding":[{"url":"https://github.com/sponsors/alessiofrittoli","type":"github"}],"gitHead":"44e194e0bf4fac8efc1c886117bf6b965a34ce1a","scripts":{"//1a":"*********************************************************************","//1b":"*********************** BUILD - LINT - RELEASE **********************","//1c":"*********************************************************************","//2a":"*********************************************************************","//2b":"***************************** UNIT TESTS ****************************","//2c":"*********************************************************************","//3a":"*********************************************************************","//3b":"************************ UNIT TESTS COVERAGE ************************","//3c":"*********************************************************************","//4a":"*********************************************************************","//4b":"************************ TARGETED UNIT TESTS ************************","//4c":"*********************************************************************","lint":"eslint","test":"jest --verbose","build":"pnpm lint && pnpm test:ci && pnpm test:ci:jsdom && tsup","release":"node scripts/publish.js --verbose --npm","test:ci":"jest --ci --verbose","test:jest":"pnpm test:watch jest.test.ts","test:jsdom":"JSDOM=true pnpm test:watch","test:watch":"jest --watchAll --verbose","build:watch":"tsup --watch","test:stream":"pnpm test:watch index.test.ts","test:ci:jsdom":"JSDOM=true pnpm test:ci","test:coverage":"pnpm test:watch --coverage","test:jest:jsdom":"JSDOM=true pnpm test:jest","test:ci:coverage":"pnpm test:ci --coverage","test:stream:jsdom":"JSDOM=true pnpm test:stream","test:coverage:jsdom":"JSDOM=true pnpm test:coverage","test:coverage:serve":"concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\"","test:serve-coverage":"http-server ./coverage/lcov-report --gzip true -p 0 -o --silent","test:coverage:jsdom:serve":"JSDOM=true pnpm test:coverage:serve"},"_npmUser":{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"},"repository":{"url":"git+https://github.com/alessiofrittoli/stream-writer.git","type":"git"},"_npmVersion":"10.9.0","description":"Easly push data to a Stream","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.4.0","dotenv":"^16.4.7","eslint":"^9.22.0","globals":"^16.0.0","ts-jest":"^29.2.6","ts-node":"^10.9.2","@eslint/js":"^9.22.0","typescript":"^5.8.2","@types/jest":"^29.5.14","@types/node":"^22.13.10","http-server":"^14.1.1","concurrently":"^9.1.2","@jest/globals":"^29.7.0","typescript-eslint":"^8.26.1","jest-environment-jsdom":"^29.7.0","@alessiofrittoli/node-scripts":"^2.3.1","@alessiofrittoli/stream-reader":"^2.2.1"},"_npmOperationalInternal":{"tmp":"tmp/stream-writer_1.1.1_1742408579905_0.6729523480483028","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@alessiofrittoli/stream-writer","version":"1.2.0","keywords":["stream","stream-writer","streaming"],"author":{"url":"https://alessiofrittoli.it","name":"Alessio Frittoli","email":"info@alessiofrittoli.it"},"license":"MIT","_id":"@alessiofrittoli/stream-writer@1.2.0","maintainers":[{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"}],"homepage":"https://github.com/alessiofrittoli/stream-writer#readme","bugs":{"url":"https://github.com/alessiofrittoli/stream-writer/issues","email":"info@alessiofrittoli.it"},"dist":{"shasum":"81a50bdf78ec046d695baa98c8ec90c31dedb34a","tarball":"https://registry.npmjs.org/@alessiofrittoli/stream-writer/-/stream-writer-1.2.0.tgz","fileCount":9,"integrity":"sha512-ZdqqMwlE4i/VOmIHkO1ro1jc9V0aZR7FljqsXJ4BQoMl1eHrFJryuJBihjnnxohv89hzzmdZxjvqNtOsNaFO1A==","signatures":[{"sig":"MEUCIQCJK8eGcTcFygxpCHf8MqwtmDEfPNrUobpcL9iMPtsN/wIgTT9nl53txy4tLJUBI6QFKxJIUBBS+CoJ2NizT+gavAU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34905},"main":"./dist/index.js","pnpm":{"onlyBuiltDependencies":["esbuild"]},"types":"./dist/index.d.ts","module":"./dist/index.mjs","funding":[{"url":"https://github.com/sponsors/alessiofrittoli","type":"github"}],"gitHead":"4af5b0bb8153beb7c6458f72c861218588fc45ab","scripts":{"//1a":"*********************************************************************","//1b":"*********************** BUILD - LINT - RELEASE **********************","//1c":"*********************************************************************","//2a":"*********************************************************************","//2b":"***************************** UNIT TESTS ****************************","//2c":"*********************************************************************","//3a":"*********************************************************************","//3b":"************************ UNIT TESTS COVERAGE ************************","//3c":"*********************************************************************","//4a":"*********************************************************************","//4b":"************************ TARGETED UNIT TESTS ************************","//4c":"*********************************************************************","lint":"eslint","test":"jest --verbose","build":"pnpm lint && pnpm test:ci && pnpm test:ci:jsdom && tsup","release":"node scripts/publish.js --verbose --npm","test:ci":"jest --ci --verbose","test:jsdom":"JSDOM=true pnpm test:watch","test:watch":"jest --watchAll --verbose","build:watch":"tsup --watch","test:stream":"pnpm test:watch index.test.ts","test:ci:jsdom":"JSDOM=true pnpm test:ci","test:coverage":"pnpm test:watch --coverage","test:ci:coverage":"pnpm test:ci --coverage","test:stream:jsdom":"JSDOM=true pnpm test:stream","test:coverage:jsdom":"JSDOM=true pnpm test:coverage","test:coverage:serve":"concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\"","test:serve-coverage":"http-server ./coverage/lcov-report --gzip true -p 0 -o --silent","test:coverage:jsdom:serve":"JSDOM=true pnpm test:coverage:serve"},"_npmUser":{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"},"repository":{"url":"git+https://github.com/alessiofrittoli/stream-writer.git","type":"git"},"_npmVersion":"10.9.0","description":"Easly push data to a Stream","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.4.0","dotenv":"^16.4.7","eslint":"^9.22.0","globals":"^16.0.0","ts-jest":"^29.2.6","ts-node":"^10.9.2","@eslint/js":"^9.22.0","typescript":"^5.8.2","@types/jest":"^29.5.14","@types/node":"^22.13.11","http-server":"^14.1.1","concurrently":"^9.1.2","@jest/globals":"^29.7.0","typescript-eslint":"^8.27.0","jest-environment-jsdom":"^29.7.0","@alessiofrittoli/node-scripts":"^2.4.0","@alessiofrittoli/stream-reader":"^2.3.0"},"_npmOperationalInternal":{"tmp":"tmp/stream-writer_1.2.0_1742559369564_0.6561860759543108","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@alessiofrittoli/stream-writer","version":"1.3.0","keywords":["stream","stream-writer","streaming"],"author":{"url":"https://alessiofrittoli.it","name":"Alessio Frittoli","email":"info@alessiofrittoli.it"},"license":"MIT","_id":"@alessiofrittoli/stream-writer@1.3.0","maintainers":[{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"}],"homepage":"https://github.com/alessiofrittoli/stream-writer#readme","bugs":{"url":"https://github.com/alessiofrittoli/stream-writer/issues","email":"info@alessiofrittoli.it"},"dist":{"shasum":"32935e0b4f44c32facd26a8a7e300c94dbb05169","tarball":"https://registry.npmjs.org/@alessiofrittoli/stream-writer/-/stream-writer-1.3.0.tgz","fileCount":7,"integrity":"sha512-nchtEygrzaEFww5QW+AsA5G1q26w5sfm0bRzBS4vXB46wL5uoBgpfzkTuUIh5O6q89FvN38aIkDMk0Nf4pRfww==","signatures":[{"sig":"MEQCIE8WST5TReiV9PSG/ZPpOHJ+8/vTklAPfYFK557poUALAiB+mJUkkIc3G/tKrLQsKuDvdrqOeAl68kO0buxgqzatBg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23925},"main":"./dist/index.js","pnpm":{"onlyBuiltDependencies":["esbuild"]},"types":"./dist/index.d.ts","module":"./dist/index.mjs","funding":[{"url":"https://github.com/sponsors/alessiofrittoli","type":"github"}],"gitHead":"f1c93ff27d3b7de4747d0325fcd6638592282c65","scripts":{"dev":"NODE_ENV=development tsup --watch","//1a":"*********************************************************************","//1b":"******************** DEV - BUILD - LINT - RELEASE *******************","//1c":"*********************************************************************","//2a":"*********************************************************************","//2b":"***************************** UNIT TESTS ****************************","//2c":"*********************************************************************","//3a":"*********************************************************************","//3b":"************************ UNIT TESTS COVERAGE ************************","//3c":"*********************************************************************","lint":"eslint","test":"jest --verbose","build":"pnpm lint && pnpm test:ci && pnpm build:prod","release":"node scripts/publish.js --verbose --npm","test:ci":"jest --ci --verbose","build:prod":"NODE_ENV=production tsup","test:watch":"jest --watchAll --verbose","test:coverage":"pnpm test:watch --coverage","test:coverage:ci":"pnpm test:ci --coverage","test:coverage:serve":"concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\"","test:serve-coverage":"http-server ./coverage/lcov-report --gzip true -p 0 -o --silent"},"_npmUser":{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"},"repository":{"url":"git+https://github.com/alessiofrittoli/stream-writer.git","type":"git"},"_npmVersion":"11.0.0","description":"Easly push data to a Stream","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","dependencies":{"@alessiofrittoli/exception":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.4.0","dotenv":"^16.5.0","eslint":"^9.25.1","globals":"^16.0.0","ts-jest":"^29.3.2","ts-node":"^10.9.2","@eslint/js":"^9.25.1","typescript":"^5.8.3","@types/jest":"^29.5.14","@types/node":"^22.15.3","http-server":"^14.1.1","concurrently":"^9.1.2","@jest/globals":"^29.7.0","typescript-eslint":"^8.31.1","@alessiofrittoli/node-scripts":"^2.5.0","@alessiofrittoli/stream-reader":"^2.5.0"},"_npmOperationalInternal":{"tmp":"tmp/stream-writer_1.3.0_1746207043924_0.11347865327002604","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@alessiofrittoli/stream-writer","version":"1.4.0","description":"Easly push data to a Stream","author":{"name":"Alessio Frittoli","email":"info@alessiofrittoli.it","url":"https://alessiofrittoli.it"},"license":"MIT","funding":[{"type":"github","url":"https://github.com/sponsors/alessiofrittoli"}],"keywords":["stream","stream-writer","streaming"],"homepage":"https://github.com/alessiofrittoli/stream-writer#readme","bugs":{"url":"https://github.com/alessiofrittoli/stream-writer/issues","email":"info@alessiofrittoli.it"},"repository":{"type":"git","url":"git+https://github.com/alessiofrittoli/stream-writer.git"},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","sideEffects":false,"scripts":{"//1a":"*********************************************************************","//1b":"******************** DEV - BUILD - LINT - RELEASE *******************","//1c":"*********************************************************************","dev":"cross-env NODE_ENV=development tsup --watch","build:prod":"cross-env NODE_ENV=production tsup","build":"pnpm lint && pnpm test:ci && pnpm build:prod","lint":"eslint","release":"node scripts/release.js --verbose --npm","//2a":"*********************************************************************","//2b":"***************************** UNIT TESTS ****************************","//2c":"*********************************************************************","test":"jest --verbose","test:watch":"jest --watchAll --verbose","test:ci":"jest --ci --verbose","//3a":"*********************************************************************","//3b":"************************ UNIT TESTS COVERAGE ************************","//3c":"*********************************************************************","test:coverage":"pnpm test:watch --coverage","test:coverage:ci":"pnpm test:ci --coverage","test:serve-coverage":"http-server ./coverage/lcov-report --gzip true -p 0 -o --silent","test:coverage:serve":"concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\""},"devDependencies":{"@alessiofrittoli/node-scripts":"^3.2.0","@alessiofrittoli/stream-reader":"^2.6.1","@eslint/js":"^9.39.1","@jest/globals":"^30.2.0","@types/jest":"^30.0.0","@types/node":"^24.10.1","concurrently":"^9.2.1","cross-env":"^10.1.0","dotenv":"^17.2.3","eslint":"^9.39.1","globals":"^16.5.0","http-server":"^14.1.1","jest":"^30.2.0","ts-jest":"^29.4.6","ts-node":"^10.9.2","tsup":"^8.5.1","typescript":"^5.9.3","typescript-eslint":"^8.48.1"},"dependencies":{"@alessiofrittoli/exception":"^3.3.1"},"_id":"@alessiofrittoli/stream-writer@1.4.0","gitHead":"078d49a7d7e428daa2e99f3bef03a37002e64dc5","_nodeVersion":"22.15.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-/fe2+GaQGv/TgAnHFwaZOBPnnrHS19UyhAQzcz8R5lHzgQM3LBmHWeHKNAr01wJlR9kTnBBuWVGGSaEGDomTiQ==","shasum":"3de642a31686c8552a40f9552089455e6c192975","tarball":"https://registry.npmjs.org/@alessiofrittoli/stream-writer/-/stream-writer-1.4.0.tgz","fileCount":7,"unpackedSize":23909,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE33sgpQS886soToXhbodbx+klqjdJLiYHtu/eBMQVOnAiBPoyne66udaTgmZqBW7XSsIc0em2rXJgEj9HQI4AEDBA=="}]},"_npmUser":{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"},"directories":{},"maintainers":[{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stream-writer_1.4.0_1764785261190_0.4234248635139646"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-18T12:38:00.604Z","modified":"2025-12-03T18:07:41.590Z","1.0.0":"2025-01-18T12:38:00.927Z","1.1.0":"2025-03-19T16:11:43.606Z","1.1.1":"2025-03-19T18:23:00.110Z","1.2.0":"2025-03-21T12:16:09.757Z","1.3.0":"2025-05-02T17:30:44.123Z","1.4.0":"2025-12-03T18:07:41.390Z"},"bugs":{"url":"https://github.com/alessiofrittoli/stream-writer/issues","email":"info@alessiofrittoli.it"},"author":{"name":"Alessio Frittoli","email":"info@alessiofrittoli.it","url":"https://alessiofrittoli.it"},"license":"MIT","homepage":"https://github.com/alessiofrittoli/stream-writer#readme","keywords":["stream","stream-writer","streaming"],"repository":{"type":"git","url":"git+https://github.com/alessiofrittoli/stream-writer.git"},"description":"Easly push data to a Stream","maintainers":[{"name":"alessiofrittoli","email":"info@alessiofrittoli.it"}],"readme":"# Stream Writer 🪶\n\n[![NPM Latest Version][version-badge]][npm-url] [![Coverage Status][coverage-badge]][coverage-url] [![Socket Status][socket-badge]][socket-url] [![NPM Monthly Downloads][downloads-badge]][npm-url] [![Dependencies][deps-badge]][deps-url]\n\n[![GitHub Sponsor][sponsor-badge]][sponsor-url]\n\n[version-badge]: https://img.shields.io/npm/v/%40alessiofrittoli%2Fstream-writer\n[npm-url]: https://npmjs.org/package/%40alessiofrittoli%2Fstream-writer\n[coverage-badge]: https://coveralls.io/repos/github/alessiofrittoli/stream-writer/badge.svg\n[coverage-url]: https://coveralls.io/github/alessiofrittoli/stream-writer\n[socket-badge]: https://socket.dev/api/badge/npm/package/@alessiofrittoli/stream-writer\n[socket-url]: https://socket.dev/npm/package/@alessiofrittoli/stream-writer/overview\n[downloads-badge]: https://img.shields.io/npm/dm/%40alessiofrittoli%2Fstream-writer.svg\n[deps-badge]: https://img.shields.io/librariesio/release/npm/%40alessiofrittoli%2Fstream-writer\n[deps-url]: https://libraries.io/npm/%40alessiofrittoli%2Fstream-writer\n\n[sponsor-badge]: https://img.shields.io/static/v1?label=Fund%20this%20package&message=%E2%9D%A4&logo=GitHub&color=%23DB61A2\n[sponsor-url]: https://github.com/sponsors/alessiofrittoli\n\n## Easly push data to a Stream\n\nThe `Stream` class extends the [`TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream) interface, providing additional convenience methods for handling streams, such as writing, closing, and aborting reducing the amount of code required for those operations.\n\nIf you're interested in a simple and effective way to read streams, take a look at [`@alessiofrittoli/stream-reader`](https://npmjs.com/package/@alessiofrittoli/stream-reader) package.\n\n### Table of Contents\n\n- [Getting started](#getting-started)\n- [Key features](#key-features)\n- [API Reference](#api-reference)\n  - [Importing the library](#importing-the-library)\n  - [Properties](#properties)\n  - [Constructor](#constructor)\n  - [Methods](#methods)\n    - [`Stream.write()`](#streamwrite)\n    - [`Stream.close()`](#streamclose)\n    - [`Stream.abort()`](#streamabort)\n- [Examples](#examples)\n  - [Writing data into a stream](#writing-data-into-a-stream)\n  - [Writing data into a stream with a custom transformer](#writing-data-into-a-stream-with-a-custom-transformer)\n  - [Aborting the stream](#aborting-the-stream)\n- [Development](#development)\n  - [Install depenendencies](#install-depenendencies)\n  - [Build the source code](#build-the-source-code)\n  - [ESLint](#eslint)\n  - [Jest](#jest)\n- [Contributing](#contributing)\n- [Security](#security)\n- [Credits](#made-with-)\n\n---\n\n### Getting started\n\nRun the following command to start using `stream-writer` in your projects:\n\n```bash\nnpm i @alessiofrittoli/stream-writer\n```\n\nor using `pnpm`\n\n```bash\npnpm i @alessiofrittoli/stream-writer\n```\n\n---\n\n### Key features\n\n#### Extends `TransformStream`\n\n- Inherits all the functionality of the [`TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream) API, allowing for custom transformations of input to output streams.\n- Provides seamless integration with modern streaming APIs.\n\n#### Convenient Stream Management\n\n- `write` Method: A high-level abstraction for writing chunks of data into the stream. It handles readiness and ensures proper sequencing of write operations.\n- `close` Method: Safely closes the stream while preventing multiple or concurrent close operations.\n- `abort` Method: Gracefully aborts the stream with an optional reason, making it easier to handle errors or interruptions.\n\n#### Built-In Headers for Server Responses\n\n- The `headers` property contains default headers commonly used in server responses, such as:\n  - `Connection: keep-alive`\n  - `Transfer-Encoding: chunked`\n  - `Cache-Control: no-cache, no-transform`\n  - `X-Accel-Buffering: no`\n  - `Content-Encoding: none`\n\n#### Stream Writer Abstraction\n\n- The `writer` property provides direct access to the underlying `WritableStreamDefaultWriter`, enabling fine-grained control over the writable stream.\n- Ensures proper handling of stream readiness, errors, and resource management (e.g., releasing locks).\n\n#### Type Safety\n\n- Generic parameters (`I` for input, `O` for output) make the class type-safe and adaptable to various use cases, such as processing specific data types.\n\n#### Designed for Robustness\n\n- Internal mechanisms, ensure the class behaves predictably and avoids race conditions.\n\n#### Chainable API\n\n- Methods like `write`, `close`, and `abort` return the current `Stream` instance, enabling method chaining for more concise and readable code.\n\n#### Compatibility and Modularity\n\n- The `Stream` class can be used in both client-side and server-side applications where the `TransformStream` API is supported.\n- Its modular design makes it easy to extend or customize further for specific application needs.\n\n#### Focused on Developer Experience\n\n- Clear and concise API with thoughtful defaults.\n- Built-in documentation and examples make it easy to understand and integrate into existing projects.\n\nThese features make the `Stream` class a versatile and developer-friendly abstraction for working with streams in modern JavaScript and TypeScript environments.\n\n---\n\n### API Reference\n\n### Importing the library\n\n```ts\nimport { Stream } from '@alessiofrittoli/stream-writer'\n```\n\n---\n\n### Properties\n\n| Property   | Type                             | Description                                    |\n|------------|----------------------------------|------------------------------------------------|\n| `writable` | `WritableStream<I>`              | The writable stream instance.                  |\n| `readable` | `ReadableStream<O>`              | The readable stream instance.                  |\n| `writer`   | `WritableStreamDefaultWriter<I>` | The writer instance for the writable stream.   |\n| `closed`   | `boolean`                        | Indicates whether the stream is closed.        |\n| `headers`  | `Headers`                        | Common headers to return in a server response. |\n\n---\n\n### Constructor\n\nConstructs a new instance of the `Stream` class.\n\n| Parameter          | Type                 | Description                                           |\n|--------------------|----------------------|-------------------------------------------------------|\n| `transformer`      | `Transformer<I, O>`  | (Optional) A custom transformer for the stream.       |\n| `writableStrategy` | `QueuingStrategy<I>` | (Optional) A custom strategy for the writable stream. |\n| `readableStrategy` | `QueuingStrategy<O>` | (Optional) A custom strategy for the readable stream. |\n\n---\n\n### Methods\n\n#### `Stream.write()`\n\nWrites data into the stream.\n\n##### Parameters\n\n| Parameter | Type | Description                            |\n|-----------|------|----------------------------------------|\n| `chunk`   | `I`  | The data chunk to write to the stream. |\n\n##### Returns\n\nType: `Promise<Stream>`\n\n- A Promise that resolves to the current `Stream` instance.\n\n---\n\n#### `Stream.close()`\n\nCloses the stream.\n\n- Closes the writer if it is not already closed or in the process of closing.\n- Prevents multiple close operations when .close() is not awaited.\n- Releases the lock on the writer.\n\n##### Returns\n\nType: `Promise<Stream>`\n\n- A Promise that resolves to the current `Stream` instance.\n\n---\n\n#### `Stream.abort()`\n\nAborts the stream with an optional reason.\n\n##### Parameters\n\n| Parameter | Type     | Description                                    |\n|-----------|----------|------------------------------------------------|\n| `reason`  | `string` | (Optional) The reason for aborting the stream. |\n\n##### Returns\n\nType: `Promise<Stream>`\n\n- A Promise that resolves to the current `Stream` instance.\n\n---\n\n### Examples\n\n#### Writing data into a stream\n\n```ts\nconst routeHandler = () => {\n  const stream = new Stream()\n  \n  const streamTask = async () => {\n    await stream.write( 'data' )\n    await stream.write( 'data 2' )\n    await stream.write( 'data 3' )\n    await stream.write( 'data 4' )\n  }\n  \n  streamTask()\n    .then( () => stream.close() )\n  \n  return new Response( stream.readable, { headers: stream.headers } )\n}\n```\n\n---\n\n#### Writing data into a stream with a custom transformer\n\n```ts\nconst routeHandler = () => {\n  const encoder = new TextEncoder()\n  const stream = (\n    new Stream<string, Uint8Array>( {\n      transform( chunk, controller )\n      {\n        controller.enqueue( encoder.encode( chunk ) )\n      }\n    } )\n  )\n\n  const streamTask = async () => {\n    await stream.write( 'data' )\n    await stream.write( 'data 2' )\n    await stream.write( 'data 3' )\n    await stream.write( 'data 4' )\n  }\n\n  streamTask()\n    .then( () => stream.close() )\n\n  return new Response( stream.readable, { headers: stream.headers } )\n}\n```\n\n---\n\n#### Aborting the stream\n\n```ts\nconst routeHandler = request => {\n  request.signal.addEventListener( 'abort', () => {\n    stream.abort( 'The user aborted the request.' )\n  } )\n  \n  const stream = new Stream()\n  \n  const streamTask = async () => {\n    await stream.write( 'data' )\n    await stream.write( 'data 2' )\n    await stream.write( 'data 3' )\n    await stream.write( 'data 4' )\n  }\n  \n  streamTask()\n    .catch( error => {\n      if ( error.name === 'AbortError' ) {\n        return console.log( 'AbortError:', error.message )\n      }\n      await stream.write( error.message )\n    } )\n    .finally( () => stream.close() )\n  \n  return new Response( stream.readable, { headers: stream.headers } )\n\n}\n```\n\n---\n\nIf you're interested in a simple and effective way to read streams, take a look at [`@alessiofrittoli/stream-reader`](https://npmjs.com/package/@alessiofrittoli/stream-reader) package.\n\n---\n\n### Development\n\n#### Install depenendencies\n\n```bash\nnpm install\n```\n\nor using `pnpm`\n\n```bash\npnpm i\n```\n\n#### Build the source code\n\nRun the following command to test and build code for distribution.\n\n```bash\npnpm build\n```\n\n#### [ESLint](https://www.npmjs.com/package/eslint)\n\nwarnings / errors check.\n\n```bash\npnpm lint\n```\n\n#### [Jest](https://npmjs.com/package/jest)\n\nRun all the defined test suites by running the following:\n\n```bash\n# Run tests and watch file changes.\npnpm test:watch\n\n# Run tests in a CI environment.\npnpm test:ci\n```\n\n- See [`package.json`](./package.json) file scripts for more info.\n\nRun tests with coverage.\n\nAn HTTP server is then started to serve coverage files from `./coverage` folder.\n\n⚠️ You may see a blank page the first time you run this command. Simply refresh the browser to see the updates.\n\n```bash\ntest:coverage:serve\n```\n\n---\n\n### Contributing\n\nContributions are truly welcome!\n\nPlease refer to the [Contributing Doc](./CONTRIBUTING.md) for more information on how to start contributing to this project.\n\nHelp keep this project up to date with [GitHub Sponsor][sponsor-url].\n\n[![GitHub Sponsor][sponsor-badge]][sponsor-url]\n\n---\n\n### Security\n\nIf you believe you have found a security vulnerability, we encourage you to **_responsibly disclose this and NOT open a public issue_**. We will investigate all legitimate reports. Email `security@alessiofrittoli.it` to disclose any security vulnerabilities.\n\n### Made with ☕\n\n<table style='display:flex;gap:20px;'>\n  <tbody>\n    <tr>\n      <td>\n        <img alt=\"avatar\" src='https://avatars.githubusercontent.com/u/35973186' style='width:60px;border-radius:50%;object-fit:contain;'>\n      </td>\n      <td>\n        <table style='display:flex;gap:2px;flex-direction:column;'>\n          <tbody>\n              <tr>\n                <td>\n                  <a href='https://github.com/alessiofrittoli' target='_blank' rel='noopener'>Alessio Frittoli</a>\n                </td>\n              </tr>\n              <tr>\n                <td>\n                  <small>\n                    <a href='https://alessiofrittoli.it' target='_blank' rel='noopener'>https://alessiofrittoli.it</a> |\n                    <a href='mailto:info@alessiofrittoli.it' target='_blank' rel='noopener'>info@alessiofrittoli.it</a>\n                  </small>\n                </td>\n              </tr>\n          </tbody>\n        </table>\n      </td>\n    </tr>\n  </tbody>\n</table>\n","readmeFilename":"README.md"}