{"id":20643633,"url":"https://github.com/extrabacon/object-stream","last_synced_at":"2025-04-16T02:05:08.214Z","repository":{"id":16982037,"uuid":"19744845","full_name":"extrabacon/object-stream","owner":"extrabacon","description":"Simplified object streams based on Node streams2","archived":false,"fork":false,"pushed_at":"2021-02-18T19:53:27.000Z","size":6,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-16T02:04:51.232Z","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/extrabacon.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","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":"2014-05-13T15:34:13.000Z","updated_at":"2021-02-18T19:53:30.000Z","dependencies_parsed_at":"2022-07-26T11:47:11.376Z","dependency_job_id":null,"html_url":"https://github.com/extrabacon/object-stream","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrabacon%2Fobject-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrabacon%2Fobject-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrabacon%2Fobject-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrabacon%2Fobject-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/extrabacon","download_url":"https://codeload.github.com/extrabacon/object-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249183104,"owners_count":21226141,"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-16T16:13:28.755Z","updated_at":"2025-04-16T02:05:08.172Z","avatar_url":"https://github.com/extrabacon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# object-stream\n\nSimplified object streams based on Node streams2.\n\n## Installation\n\n```bash\nnpm install object-stream\n```\n\n## Examples\n\n#### Creating a readable stream of objects from an array\n\n```js\nvar objectStream = require('object-stream');\nobjectStream.fromArray([1, 2, 3]).pipe(...);\n```\n\nPass an empty array or anything falsy to create an empty stream.\n\n#### Collecting elements into an array\n\n```js\nvar objectStream = require('object-stream');\nobjectStream.fromArray([1, 2, 3])\n  .pipe(objectStream.toArray(function (err, array) {\n    /* array contains all items emitted from readable streams */\n  }));\n```\n\n#### Mapping objects through a transform stream\n\nSynchronously (iterator has only one argument):\n\n```js\nvar objectStream = require('object-stream');\n\nobjectStream.fromArray([1, 2, 3])\n  .pipe(objectStream.map(function (value) {\n    return value * 2;\n  }))\n  .pipe(...);\n\n// asynchronous\nobjectStream.fromArray([1, 2, 3])\n  .pipe(objectStream.map(function (value, callback) {\n    setTimeout(function () {\n      callback(null, value * 2);\n    }, 100);\n  }))\n  .pipe(...);\n```\n\nAsynchronously (iterator has two arguments: value and callback):\n\n```js\nvar objectStream = require('object-stream');\n\nobjectStream.fromArray([1, 2, 3])\n  .pipe(objectStream.map(function (value, callback) {\n    setTimeout(function () {\n      callback(null, value * 2);\n    }, 100);\n  }))\n  .pipe(...);\n```\n\n#### Saving objects through a writable stream (or any other write-like action)\n\nSynchronously (iterator has only one argument):\n\n```js\nvar objectStream = require('object-stream');\n\nfunction save(value) {\n  /* save item... */\n};\n\nobjectStream.fromArray([1, 2, 3]).pipe(objectStream.save(save));\n```\n\nAsynchronously (iterator has two arguments: value and callback):\n\n```js\nvar objectStream = require('object-stream');\n\nfunction saveAsync(value, callback) {\n  /* save item... */\n  callback();\n};\n\nobjectStream.fromArray([1, 2, 3]).pipe(objectStream.save(saveAsync));\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2014, Nicolas Mercier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextrabacon%2Fobject-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextrabacon%2Fobject-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextrabacon%2Fobject-stream/lists"}