{"id":18544757,"url":"https://github.com/131/stream-split","last_synced_at":"2025-04-09T19:31:20.779Z","repository":{"id":57372071,"uuid":"42813798","full_name":"131/stream-split","owner":"131","description":"Stream split transform","archived":false,"fork":false,"pushed_at":"2016-10-28T22:32:41.000Z","size":6,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-19T02:05:00.852Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/131.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-20T13:24:29.000Z","updated_at":"2024-06-19T02:05:00.853Z","dependencies_parsed_at":"2022-08-30T16:42:51.787Z","dependency_job_id":null,"html_url":"https://github.com/131/stream-split","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fstream-split","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fstream-split/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fstream-split/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fstream-split/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/131","download_url":"https://codeload.github.com/131/stream-split/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223407832,"owners_count":17140570,"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":[],"created_at":"2024-11-06T20:17:30.587Z","updated_at":"2024-11-06T20:17:31.306Z","avatar_url":"https://github.com/131.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Split stream\r\n\r\nA very efficient stream splitter (using buffer delimiters)\r\n\r\nGenerate a duplex stream (transform) that split your stream into controlled chunks\r\n\r\n[![Build Status](https://travis-ci.org/131/stream-split.svg?branch=master)](https://travis-ci.org/131/stream-split)\r\n[![Coverage Status](https://coveralls.io/repos/github/131/stream-split/badge.svg?branch=master)](https://coveralls.io/github/131/stream-split?branch=master)\r\n[![Version](https://img.shields.io/npm/v/stream-split.svg)](https://www.npmjs.com/package/stream-split)\r\n\r\n\r\n# Api\r\n```\r\nvar Split    = require('stream-split');\r\nvar splitter = new Split(buffer_separator[, options]);\r\n\r\n\r\n  //target will receive \"buffer_separator\" separated chunks\r\nsomestream.pipe(splitter).pipe(target);\r\n\r\n\r\nvar options = {\r\n  //bufferSize  : internal buffer size (default to 1 Mb)\r\n};\r\n\r\n```\r\n\r\n\r\n## Options\r\n* bufferSize \r\n`stream-split` use efficiant buffer copy policy (instead of merging/concat temporary chunk).\r\nThis value is an indication on what the working page size might be.\r\nIf needed, this value WILL change according to data.\r\n\r\n\r\n# Example\r\n```\r\nconst Split = require('stream-split');\r\nconst splitter = new Split(new Buffer(\"\\r\\n\"));\r\n\r\n\r\nsplitter.on(\"data\", function(){\r\n  //got chunk\r\n});\r\n\r\n\r\nsplitter.write(\"ok\");\r\nsplitter.write(\"\\r\\n\"); //got chunk\r\nsplitter.write(\"ok\");\r\n```\r\n\r\n\r\n# Tests\r\n```\r\nnpm test\r\n```\r\n\r\nRun tests for mocha result \u0026 istanbul (100%) coverage\r\n\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F131%2Fstream-split","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F131%2Fstream-split","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F131%2Fstream-split/lists"}