{"id":17398427,"url":"https://github.com/vweevers/tabular-stream","last_synced_at":"2025-04-30T06:28:15.861Z","repository":{"id":32634030,"uuid":"36220169","full_name":"vweevers/tabular-stream","owner":"vweevers","description":"Detects tabular data (spreadsheets, dsv or json, 20+ different formats) and emits normalized objects.","archived":false,"fork":false,"pushed_at":"2023-11-01T13:58:09.000Z","size":239,"stargazers_count":36,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-09T07:34:26.191Z","etag":null,"topics":["csv","dsv","json","ndjson","nodejs","ods","qpw","spreadsheets","stream","sylk","tabular-data","tsv","xls","xlsx"],"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/vweevers.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-25T08:46:25.000Z","updated_at":"2023-12-10T14:49:29.000Z","dependencies_parsed_at":"2024-10-23T03:25:07.672Z","dependency_job_id":null,"html_url":"https://github.com/vweevers/tabular-stream","commit_stats":{"total_commits":38,"total_committers":3,"mean_commits":"12.666666666666666","dds":0.1578947368421053,"last_synced_commit":"2d6762f75aa9120faa3c5b529b691a80d237c4ed"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ftabular-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ftabular-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ftabular-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ftabular-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vweevers","download_url":"https://codeload.github.com/vweevers/tabular-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233217060,"owners_count":18643032,"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","dsv","json","ndjson","nodejs","ods","qpw","spreadsheets","stream","sylk","tabular-data","tsv","xls","xlsx"],"created_at":"2024-10-16T14:56:17.464Z","updated_at":"2025-01-09T15:52:45.348Z","avatar_url":"https://github.com/vweevers.png","language":"JavaScript","readme":"# tabular-stream\n\n\u003e Note: the core of `tabular-stream` 1.0 has moved to [`detect-tabular`](https://www.npmjs.com/package/detect-tabular). This is now a data normalizer on top of that.\n\n**[Detects tabular data](https://www.npmjs.com/package/detect-tabular) (spreadsheets, dsv or json, 20+ different formats) and emits objects. Ensures all rows [have the same keys, optionally transforms keys](https://www.npmjs.com/package/map-tabular-keys) and tries to [coerce values to numbers](https://www.npmjs.com/package/coerce-tabular). Spreadsheets and DSV must have a header.**\n\n[![npm status](http://img.shields.io/npm/v/tabular-stream.svg)](https://www.npmjs.org/package/tabular-stream)\n[![node](https://img.shields.io/node/v/tabular-stream.svg)](https://www.npmjs.org/package/tabular-stream)\n[![Test](https://img.shields.io/github/workflow/status/vweevers/tabular-stream/Test?label=test)](https://github.com/vweevers/tabular-stream/actions/workflows/test.yml)\n[![Standard](https://img.shields.io/badge/standard-informational?logo=javascript\u0026logoColor=fff)](https://standardjs.com)\n\n## Example\n\n```\nnpm i tabular-stream snake-case format-data\n```\n\n```js\nconst tabular = require('tabular-stream')\nconst fs = require('fs')\nconst snake = require('snake-case').snakeCase\nconst format = require('format-data')\n\nfs.createReadStream('test/air_pollution_nl.xlsx')\n  .pipe(tabular(snake))\n  .pipe(format('json'))\n  .pipe(process.stdout)\n```\n\n**Need a CLI doing just this?** Jump to [`tabular-cli`](https://www.npmjs.com/package/tabular-cli), which pairs `tabular-stream` with `format-data` to convert tabular data to json, ndjson, dsv or sse. For example:\n\n```\ntabular -k snake-case -o tsv \u003c input.xls \u003e output.tsv\n```\n\n## API\n\n### `tabular([keys || options])`\n\nReturns a duplex stream - give it any tabular data, get back objects. `(keys)` is a shorthand for `({ keys: keys })`. The available options are:\n\n#### `function keys`\n\nAn optional function to [transform and/or filter keys](https://www.npmjs.com/package/map-tabular-keys). Receives a single argument, for every key of the first row. Everything at [`change-case`](https://www.npmjs.com/package/change-case) works well. If it returns an empty string or anything other than a string, the key is ignored (i.e. not included in the emitted objects).\n\n```js\nfunction keys(key) {\n  if (key === 'useless') return false\n  return key.toUpperCase()\n}\n```\n\n#### `mixed defaultValue`\n\nFallback value to use for `null` and `undefined` values. **Default is `0`**.\n\n#### `boolean bare`\n\nWhether to emit null prototype objects via `Object.create(null)` or plain javascript objects **(the default)**.\n\n#### Other\n\nOther options are passed as-is to [`spreadsheet-stream`](https://github.com/vweevers/spreadsheet-stream) (if applicable). NB. Because the binary spreadsheets formats are not streamable, `spreadsheet-stream` will buffer the whole thing in memory. As a safe-guard you can set the `maxSize` option (in bytes): `tabular({ maxSize: 1024 * 1024 })`. See [`spreadsheet-stream`](https://github.com/vweevers/spreadsheet-stream) for details.\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install tabular-stream\n```\n\n## License\n\n[MIT](LICENSE).\n\nTest data © Statistics Netherlands, The Hague/Heerlen.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Ftabular-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvweevers%2Ftabular-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Ftabular-stream/lists"}