{"id":19621392,"url":"https://github.com/commenthol/streamss-readonly","last_synced_at":"2025-06-29T23:38:09.124Z","repository":{"id":25555303,"uuid":"28988389","full_name":"commenthol/streamss-readonly","owner":"commenthol","description":"Make streams2 readonly","archived":false,"fork":false,"pushed_at":"2021-10-10T05:37:56.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-29T23:38:06.258Z","etag":null,"topics":["readonly","stream2"],"latest_commit_sha":null,"homepage":"","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/commenthol.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":"2015-01-08T22:05:03.000Z","updated_at":"2021-10-10T05:37:59.000Z","dependencies_parsed_at":"2022-08-24T06:51:04.405Z","dependency_job_id":null,"html_url":"https://github.com/commenthol/streamss-readonly","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/commenthol/streamss-readonly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fstreamss-readonly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fstreamss-readonly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fstreamss-readonly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fstreamss-readonly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commenthol","download_url":"https://codeload.github.com/commenthol/streamss-readonly/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fstreamss-readonly/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262685443,"owners_count":23348420,"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":["readonly","stream2"],"created_at":"2024-11-11T11:22:44.153Z","updated_at":"2025-06-29T23:38:09.089Z","avatar_url":"https://github.com/commenthol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# streamss-readonly\n\n\u003e Make streams2 read-only\n\n[![NPM version](https://badge.fury.io/js/streamss-readonly.svg)](https://www.npmjs.com/package/streamss-readonly/)\n[![Build Status](https://secure.travis-ci.org/commenthol/streamss-readonly.svg?branch=master)](https://travis-ci.org/commenthol/streamss-readonly)\n\nWraps any kind of stream to behave like a [Readable][] Stream. This is a pure Stream2 implementation which respects `highWaterMark` and saturation of piped streams.\n\nWorks with node v0.8.x and greater.\nFor node v0.8.x the user-land copy [readable-stream][] is used.\nFor all other node versions greater v0.8.x the built-in `stream` module is used.\n\nCredits go to [read-only-stream][].\n\n### Example\n\n``` javascript\nlet through = require('streamss').Through\nlet readonly = require('streamss-readonly')\n\nlet th = through()\nlet ro = readonly(th)\n\nro.pipe(process.stdout)\nth.write('hello world')\n\n// ro.write('this throws')\n```\n\n## Methods\n\n### readonly(stream)\n\n\u003e Converts any stream into a read-only stream\n\n**Parameters:**\n\n- `{Readable | Transform | Duplex} stream` - A stream which shall behave as a Readable only stream.\n\n**Return:**\n\n`{Readable}` - A read-only readable stream\n\n**Throws:**\n\n- `{Error}` \"not a readable stream\" - if stream does not implement a Readable component this error is thrown\n\n\n## Contribution and License Agreement\n\nIf you contribute code to this project, you are implicitly allowing your\ncode to be distributed under the MIT license. You are also implicitly\nverifying that all code is your original work or correctly attributed\nwith the source of its origin and licence.\n\n### npm scripts\n\n* `npm test`      - Run tests\n* `npm run cover` - Run istanbul code coverage (shows code coverage; open ./coverage/lcov-report/index.html after run)\n* `npm run lint`  - Linting the source\n* `npm run doc`   - Generate documentation from source (open ./doc/index.html after run)\n\n## License\n\nCopyright (c) 2015- commenthol (MIT License)\n\nSee [LICENSE][] for more info.\n\n[LICENSE]: ./LICENSE\n[read-only-stream]: https://github.com/substack/read-only-stream\n[Readable]: http://nodejs.org/api/stream.html#stream_class_stream_readable\n[readable-stream]: https://github.com/isaacs/readable-stream\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fstreamss-readonly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommenthol%2Fstreamss-readonly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fstreamss-readonly/lists"}