{"id":17315346,"url":"https://github.com/frando/smoosh-stream","last_synced_at":"2025-03-27T01:27:48.093Z","repository":{"id":57364243,"uuid":"126599670","full_name":"Frando/smoosh-stream","owner":"Frando","description":"Flatten an array and pass to a callback. Useful with e.g. bulk-write-stream.","archived":false,"fork":false,"pushed_at":"2018-03-24T23:14:08.000Z","size":2,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T07:17:33.241Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Frando.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":"2018-03-24T13:02:13.000Z","updated_at":"2018-09-25T02:31:14.000Z","dependencies_parsed_at":"2022-08-29T14:41:54.004Z","dependency_job_id":null,"html_url":"https://github.com/Frando/smoosh-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/Frando%2Fsmoosh-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frando%2Fsmoosh-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frando%2Fsmoosh-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frando%2Fsmoosh-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Frando","download_url":"https://codeload.github.com/Frando/smoosh-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245763280,"owners_count":20668251,"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-15T13:07:43.824Z","updated_at":"2025-03-27T01:27:48.075Z","avatar_url":"https://github.com/Frando.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smoosh-stream\n\nA function to flatten an array and call a passed-in callback. Useful e.g. with [bulk-write-stream](https://github.com/mafintosh/bulk-write-stream) to accept arrays and single objects likewise and always get a flattened array in the write callback.\n\n# Installation\n\n`npm install smoosh-stream`\n\n## Usage\n\n``` js\nvar smoosh = require('smoosh-stream')\nvar bulk = require('bulk-write-stream')\n\nvar stream = bulk.obj(smoosh(write))\n\nfunction write (batch, cb) {\n  batch.forEach(function (obj) {\n    console.log(obj)\n  })\n  cb(null)\n}\n\nstream.write('first')\nstream.write(['second', 'third'])\nstream.write(['forth'])\nstream.write('last')\n\n// Prints:\n// first\n// second\n// third\n// forth\n// last\n\n```\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrando%2Fsmoosh-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrando%2Fsmoosh-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrando%2Fsmoosh-stream/lists"}