{"id":20820617,"url":"https://github.com/hubgit/input-stream","last_synced_at":"2025-07-07T06:33:26.623Z","repository":{"id":28849052,"uuid":"119509362","full_name":"hubgit/input-stream","owner":"hubgit","description":"Read data from a CSV or NDJSON file to a stream","archived":false,"fork":false,"pushed_at":"2022-04-09T07:17:40.000Z","size":189,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-28T00:45:58.554Z","etag":null,"topics":["csv","ndjson","stream"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/input-stream","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/hubgit.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":"2018-01-30T08:57:06.000Z","updated_at":"2022-04-09T07:12:59.000Z","dependencies_parsed_at":"2022-08-07T14:00:51.925Z","dependency_job_id":null,"html_url":"https://github.com/hubgit/input-stream","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/hubgit/input-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubgit%2Finput-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubgit%2Finput-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubgit%2Finput-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubgit%2Finput-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hubgit","download_url":"https://codeload.github.com/hubgit/input-stream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubgit%2Finput-stream/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263585667,"owners_count":23484482,"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":["csv","ndjson","stream"],"created_at":"2024-11-17T22:09:40.245Z","updated_at":"2025-07-07T06:33:26.605Z","avatar_url":"https://github.com/hubgit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# input-stream\n\n## Install\n\n`npm install --save input-stream`\n\nor\n\n`yarn add input-stream`\n\n## Formats\n\nThe input stream functions as an async iterator, so each item can be awaited in a `for` loop.\n\n### CSV\n\n```js\nconst input = require('input-stream')('data/example.csv')\n\nfor await (const item of input) {\n  console.log(item)\n}\n```\n\nOptions provided as a second parameter will be passed through to [csv-parser](https://www.npmjs.com/package/csv-parser).\n\n### TSV\n\n```js\nconst input = require('input-stream')('data/example.tsv')\n\nfor await (const item of input) {\n  console.log(item)\n}\n```\n\nOptions provided as a second parameter will be passed through to [csv-parser](https://www.npmjs.com/package/csv-parser), apart from `separator`.\n\n### NDJSON\n\n```js\nconst input = require('input-stream')('data/example.ndjson')\n\nfor await (const item of input) {\n  console.log(item)\n}\n```\n\n### XML\n\n```js\nconst input = require('input-stream')('data/example.xml', {\n  element: 'foo'\n})\n\nfor await (const item of input) {\n  console.log(item)\n}\n```\n\nOptions provided as a second parameter will be passed through to xml-stream, apart from `output`.\n\n\n## Piping to an output stream\n\nAn example of piping the input stream directly to [output-stream](https://www.npmjs.com/package/output-stream), for conversion between formats.\n\n```js\nconst input = require('input-stream')('data/example.csv')\nconst output = require('output-stream')('data/example.ndjson')\n\ninput.pipe(output)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhubgit%2Finput-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhubgit%2Finput-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhubgit%2Finput-stream/lists"}