{"id":27868142,"url":"https://github.com/falinor/web-streams-utils","last_synced_at":"2026-03-02T03:03:58.590Z","repository":{"id":288568148,"uuid":"968531341","full_name":"Falinor/web-streams-utils","owner":"Falinor","description":"Utility functions for the Web Stream API, for browsers and node.js","archived":false,"fork":false,"pushed_at":"2025-05-20T09:17:31.000Z","size":267,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-19T00:02:17.125Z","etag":null,"topics":["web-streams","whatwg-streams"],"latest_commit_sha":null,"homepage":"https://falinor.github.io/web-streams-utils/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Falinor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-18T08:47:51.000Z","updated_at":"2025-05-20T09:17:35.000Z","dependencies_parsed_at":"2025-05-04T22:58:39.375Z","dependency_job_id":"f1ed9067-6601-4261-a473-9bb4fe11f78e","html_url":"https://github.com/Falinor/web-streams-utils","commit_stats":null,"previous_names":["falinor/web-streams-utils"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Falinor/web-streams-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Falinor%2Fweb-streams-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Falinor%2Fweb-streams-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Falinor%2Fweb-streams-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Falinor%2Fweb-streams-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Falinor","download_url":"https://codeload.github.com/Falinor/web-streams-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Falinor%2Fweb-streams-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29991299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["web-streams","whatwg-streams"],"created_at":"2025-05-04T22:58:35.518Z","updated_at":"2026-03-02T03:03:58.560Z","avatar_url":"https://github.com/Falinor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web streams utils\n\nA TypeScript library providing utility functions for working with the Web Stream\nAPI.\n\n## Installation\n\n```bash\nnpm install web-streams-utils\n```\n\n## Features\n\n- Fully typed with TypeScript\n- Zero dependencies\n- Works in both Node.js and browsers\n- Provides common stream operations like map, filter, tap, etc.\n- Compatible with the standard Web Streams API\n- Supports both ESM and CommonJS imports\n\n## Usage\n\n### ESM (ECMAScript Modules)\n\n```typescript\nimport { fromIterable, map, filter, toArray } from 'web-streams-utils'\n\nasync function example() {\n  const inputData = [1, 2, 3, 4, 5]\n\n  const stream = fromIterable(inputData)\n    .pipeThrough(filter(n =\u003e n % 2 === 0)) // Keep even numbers\n    .pipeThrough(map(n =\u003e n * 2)) // Double each number\n\n  const result = await toArray(stream)\n  console.log(result) // [4, 8]\n}\n\nexample()\n```\n\n### CommonJS\n\n```javascript\nconst { fromIterable, map, filter, toArray } = require('web-streams-utils')\n\nasync function example() {\n  const inputData = [1, 2, 3, 4, 5]\n\n  const stream = fromIterable(inputData)\n    .pipeThrough(filter(n =\u003e n % 2 === 0))\n    .pipeThrough(map(n =\u003e n * 2))\n\n  const result = await toArray(stream)\n  console.log(result) // [4, 8]\n}\n\nexample()\n```\n\n## API Reference\n\n### Transformation Functions\n\n- `append\u003cT\u003e(...items: T[]): TransformStream\u003cT, T\u003e`\n- `map\u003cT, R\u003e(fn: (chunk: T) =\u003e R | Promise\u003cR\u003e): TransformStream\u003cT, R\u003e`\n- `filter\u003cT\u003e(predicate: (chunk: T) =\u003e boolean | Promise\u003cboolean\u003e): TransformStream\u003cT, T\u003e`\n- `tap\u003cT\u003e(fn: (chunk: T) =\u003e void | Promise\u003cvoid\u003e): TransformStream\u003cT, T\u003e`\n- `batch\u003cT\u003e(size: number): TransformStream\u003cT, T[]\u003e`\n- `flatten\u003cT\u003e(): TransformStream\u003cT[], T\u003e`\n- `take\u003cT\u003e(limit: number): TransformStream\u003cT, T\u003e`\n- `skip\u003cT\u003e(count: number): TransformStream\u003cT, T\u003e`\n- `scan\u003cT, R\u003e(scanner: (accumulator: R, chunk: T) =\u003e R | Promise\u003cR\u003e, initialValue: R): TransformStream\u003cT, R\u003e`\n- `compact\u003cT\u003e(): TransformStream\u003cT, NonNullable\u003cT\u003e\u003e`\n- `flatMap\u003cT, R\u003e(fn: (chunk: T) =\u003e R[] | Promise\u003cR[]\u003e): TransformStream\u003cT, R\u003e`\n- `reduce\u003cT\u003e(reducer: (accumulator: T, chunk: T) =\u003e T | Promise\u003cT\u003e): TransformStream\u003cT, T\u003e`\n\n### Stream Creation\n\n- `fromIterable\u003cT\u003e(iterable: Iterable\u003cT\u003e | AsyncIterable\u003cT\u003e): ReadableStream\u003cT\u003e`\n- `interval(period: number): ReadableStream\u003cnumber\u003e`\n\n### Stream Combination\n\n- `merge\u003cT\u003e(...streams: ReadableStream\u003cT\u003e[]): ReadableStream\u003cT\u003e`\n\n### Consumption\n\n- `toArray\u003cT\u003e(stream: ReadableStream\u003cT\u003e): Promise\u003cT[]\u003e`\n\n## Documentation\n\nThe complete API documentation is available at [https://falinor.github.io/web-streams-utils/](https://falinor.github.io/web-streams-utils/).\n\nYou can also generate the documentation locally:\n\n```bash\nyarn docs\n```\n\nThe documentation will be available in the `docs/` directory.\n\n## Development\n\n### Setup\n\n```bash\ncorepack enable\nyarn install\n```\n\n### Testing\n\n```bash\nyarn test\nyarn test:watch\nyarn test:coverage\n```\n\n### Formatting\n\n```bash\nyarn format\n```\n\n### Committing Changes\n\nThis project uses [Conventional Commits](https://www.conventionalcommits.org/)\nfor commit messages. You can use the following command to create a commit:\n\n```bash\nyarn commit\n```\n\n### Releasing\n\nThis project uses [semantic-release](https://semantic-release.gitbook.io/semantic-release/)\nfor automated versioning and releases. Releases are automatically triggered by\nGitHub Actions when changes are pushed to the main branch. The workflow will:\n\n1. Analyze commit messages to determine the next version\n2. Generate release notes\n3. Update the CHANGELOG.md\n4. Publish to npm\n5. Create a GitHub release\n6. Deploy documentation to GitHub Pages\n\nThe release process requires the following GitHub secrets to be set:\n\n- `GITHUB_TOKEN`: Automatically provided by GitHub Actions\n- `NPM_TOKEN`: Your npm authentication token with publish permissions\n\n## Browser Support\n\nThis library supports all modern browsers and Node.js 16+. It uses the Web\nStreams API, which is available in all modern browsers and Node.js.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalinor%2Fweb-streams-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffalinor%2Fweb-streams-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalinor%2Fweb-streams-utils/lists"}