{"id":26190090,"url":"https://github.com/zazuko/csv-validate","last_synced_at":"2025-04-15T02:09:35.794Z","repository":{"id":52548830,"uuid":"294689514","full_name":"zazuko/csv-validate","owner":"zazuko","description":"Client Side and CLI JS validator.","archived":false,"fork":false,"pushed_at":"2022-10-27T14:16:41.000Z","size":300,"stargazers_count":5,"open_issues_count":3,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T14:01:38.713Z","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/zazuko.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":"2020-09-11T12:28:18.000Z","updated_at":"2024-08-31T16:03:45.000Z","dependencies_parsed_at":"2023-01-20T13:32:09.762Z","dependency_job_id":null,"html_url":"https://github.com/zazuko/csv-validate","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/zazuko%2Fcsv-validate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zazuko%2Fcsv-validate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zazuko%2Fcsv-validate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zazuko%2Fcsv-validate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zazuko","download_url":"https://codeload.github.com/zazuko/csv-validate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248557870,"owners_count":21124165,"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":"2025-03-12T00:52:28.013Z","updated_at":"2025-04-15T02:09:35.766Z","avatar_url":"https://github.com/zazuko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csv-validate: Validating CSV Parser\nThis JS CSV validating parser is based on [csv-parse](https://github.com/wdavidw/node-csv-parse) and [csv-sniffer](https://github.com/MonetDBSolutions/npm-csv-sniffer). It features data streaming, error tracing, and automatic identification of the CSV delimiters and quotes.\n\n`csv-validate` provides both NodeJS module (NPM), optional console UI (CLI), and browser/Web UI for the local validation of CSV files.\n\n`\\author` Artem Lutov \u003clua\u0026#64;\u0026#108;utan\u0026#46;ch\u003e  \n`\\affiliation` [Zazuko GmbH](https://zazuko.com), [Lutov Analytics](https://lutan.ch)  \n`\\license` [Apache 2](https://www.apache.org/licenses/LICENSE-2.0)  \n\n## Web UI\nThe Web UI bundle is located in `dist/` and consists of 3 files (and optional `test.csv` example to test the web app):\n```sh\ndist/\n  index.html\n  styles.css\n  main.js\n```\n\nTo build the Web UI, just execute `npm run build` from the package directory, producing the `main.js` bundle in `dist/`. Afterward, open `index.html` in your browser to use the web app:\n![WebUI screenshot](img/csv-validate_WebUI.png)\n\n## CLI\nConsole UI provides the following interface:\n```sh\n$ npx csv-validate -h\nUsage: csv-validate [options] \u003cfilename\u003e\n\nOptions:\n  -r, --relax-column-count   relax column count instead of emitting an error\n  -s, --skip-error-lines     skip lines with errors instead of emitting an\n                             error\n  -d, --delimiter \u003csymbol\u003e   enforce specified CSV delimiter instead of\n                             inferring it\n  -q, --quotes \u003cl-r-quotes\u003e  left [and right if distinct] quote symbols instead\n                             of inferring them (default: \"\")\n  -n, --new-line \u003cstring\u003e    enforce specified CSV new line (e.g., \\r\\n)\n                             instead of inferring it\n  -e, --encoding \u003cstring\u003e    file encoding (default: \"utf8\")\n  -h, --help                 display help for command\n```\n\nTo install it, execute:\n```sh\n$ npm install [-g] csv-validate\n```\nOtherwise, the executable can be called from the package sources as:\n```sh\n$ bin/csv-validate.js -h\n```\n\n## NodeJS Module\nThe module interface abstracts [csv-parse](https://github.com/wdavidw/node-csv-parse) and [csv-sniffer](https://github.com/MonetDBSolutions/npm-csv-sniffer).\n\n### Interface\nThe main interface is represented by a single function (see [index.js](index.js): `Parser`):\n```js\nstatic import (input: readable-stream.Readable, options: Object)\n```\nwhere the possible options are (see [index.js](index.js): `Parser constructor`):\n```ts\nrelaxColumnCount: boolean,  // Default: undefined (false)\nskipLinesWithError: boolean,  // Default: undefined (false)\ndelimiter: string,  // Item delimiter, e.g. ',' or ' '. Default: automatically inferred\nquotes: string,  // Item quotation symbol, e.g. '\\'' or '\"'. Default: automatically inferred\nnewLine: string  // A record separator, which is a newline character set, e.g., '\\n' or '\\n\\r'. Default: automatically inferred\n```\n\n### Usage\nThe interface can be used as follows:\n```js\nconst CsvValidatingParser = require('csv-validate\"')\nconst { PassThrough } = require('readable-stream')\n\nconst input = new PassThrough()\ninput.write('key1,key2\\n')\ninput.write('value1_1,value2_1\\n')\ninput.write('value1_2,value2_2\\n')\ninput.end()\n\nCsvValidatingParser.import(input, { newLine: '\\n' })\n```\nSee [test/interface.test.js](test/interface.test.js) for more examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzazuko%2Fcsv-validate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzazuko%2Fcsv-validate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzazuko%2Fcsv-validate/lists"}