{"id":15399813,"url":"https://github.com/mcollina/never-ending-stream","last_synced_at":"2025-04-16T00:23:58.865Z","repository":{"id":26750077,"uuid":"30207871","full_name":"mcollina/never-ending-stream","owner":"mcollina","description":"Automatically restarts your stream for you when it ends","archived":false,"fork":false,"pushed_at":"2016-01-25T18:59:18.000Z","size":12,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T03:12:07.407Z","etag":null,"topics":[],"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/mcollina.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-02-02T20:49:19.000Z","updated_at":"2024-08-31T06:53:32.000Z","dependencies_parsed_at":"2022-09-03T18:41:03.496Z","dependency_job_id":null,"html_url":"https://github.com/mcollina/never-ending-stream","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcollina%2Fnever-ending-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcollina%2Fnever-ending-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcollina%2Fnever-ending-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcollina%2Fnever-ending-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcollina","download_url":"https://codeload.github.com/mcollina/never-ending-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986070,"owners_count":21194021,"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-10-01T15:50:31.424Z","updated_at":"2025-04-16T00:23:58.831Z","avatar_url":"https://github.com/mcollina.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# never-ending-stream\n\nAutomatically restarts your stream for you when it ends.\nThis can be easily use to concatenate multiple streams.\n\n## Usage\n\n```js\n'use strict'\n\nvar nes = require('never-ending-stream')\nvar from = require('from2')\nvar chunks = [new Buffer('hello'), new Buffer('world')]\nvar count = 0\n\nvar stream = nes(function () {\n  if (count++ === 2) {\n    // close the stream after 2 runs\n    return null\n  }\n\n  var source = [].concat(chunks)\n\n  return from.obj(function (size, next) {\n    var chunk = source.shift() || null\n    next(null, chunk)\n  })\n})\n\n// prints\n//  hello\n//  world\n//  hello\n//  world\nstream.on('data', function (data) {\n  console.log(data.toString())\n})\n```\n\n## API\n\n### neverEndingStream([opts,] build([cb]))\n\nCreates a binary never-ending stream, by concatenating all streams\ngenerated by `build`. `build` is called whenever the\nprevious stream completes.\n\n`build` can be synchronous or asynchronous:\n\n* if it accepts no callback, is synchronous, and it should return the\n  stream, or `null` to close the `never-ending-stream`.\n\n* if it accepts a callback, is asynchronous, and you should call the\n  callback when the next stream is ready, like `cb(null, stream)`.\n\nAll other options will be passed to [through2](http://npm.im/through2).\n\n### neverEndingStream.obj([opts, ], build([cb]))\n\nLike `neverEndingStream()`, but with `objectMode: true` by default.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcollina%2Fnever-ending-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcollina%2Fnever-ending-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcollina%2Fnever-ending-stream/lists"}