{"name":"csv-parse","version":"6.1.0","keywords":["csv","parse","parser","convert","tsv","stream","backend","frontend"],"author":"David Worms <david@adaltas.com> (https://www.adaltas.com)","license":"MIT","_id":"csv-parse@6.1.0","maintainers":[{"name":"david","email":"david@adaltas.com"}],"contributors":["David Worms <david@adaltas.com> (https://www.adaltas.com)","Will White (https://github.com/willwhite)","Justin Latimer (https://github.com/justinlatimer)","jonseymour (https://github.com/jonseymour)","pascalopitz (https://github.com/pascalopitz)","Josh Pschorr (https://github.com/jpschorr)","Elad Ben-Israel (https://github.com/eladb)","Philippe Plantier (https://github.com/phipla)","Tim Oxley (https://github.com/timoxley)","Damon Oehlman (https://github.com/DamonOehlman)","Alexandru Topliceanu (https://github.com/topliceanu)","Visup (https://github.com/visup)","Edmund von der Burg (https://github.com/evdb)","Douglas Christopher Wilson (https://github.com/dougwilson)","Joe Eaves (https://github.com/Joeasaurus)","Mark Stosberg (https://github.com/markstos)"],"homepage":"https://csv.js.org/parse","dist":{"shasum":"c642ec5b7fc57c1f477a07d179beb5ff0dfd5ed0","tarball":"http://registry-npm.ywwl.com/csv-parse/download/csv-parse-6.1.0.tgz","fileCount":30,"integrity":"sha512-CEE+jwpgLn+MmtCpVcPtiCZpVtB6Z2OKPTr34pycYYoL7sxdOkXDdQ4lRiw6ioC0q6BLqhc6cKweCVvral8yhw==","signatures":[{"sig":"MEQCIDhmE/8bGOFtgXGbNRwOv6r5TkKxevP8dfKdavqkx2clAiA9Gvv9zjkIAUyhlZocd6Mo/0lXtpxqf/aF/5dj32CWNQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1438059,"size":271680,"noattachment":false,"key":"/csv-parse/-/csv-parse-6.1.0.tgz"},"main":"./dist/cjs/index.cjs","type":"module","mocha":{"loader":"ts-node/esm","timeout":40000,"reporter":"spec","recursive":true,"inline-diffs":true,"throw-deprecation":false},"types":"dist/esm/index.d.ts","exports":{".":{"import":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"}},"./sync":{"import":{"types":"./lib/sync.d.ts","default":"./lib/sync.js"},"require":{"types":"./dist/cjs/sync.d.cts","default":"./dist/cjs/sync.cjs"}},"./stream":{"import":{"types":"./lib/stream.d.ts","default":"./lib/stream.js"},"require":{"types":"./dist/cjs/stream.d.cts","default":"./dist/cjs/stream.cjs"}},"./browser/esm":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"./browser/esm/sync":{"types":"./dist/esm/sync.d.ts","default":"./dist/esm/sync.js"}},"gitHead":"c0e42c9cf0ec6b9e1f453279e36f621ce782d2eb","scripts":{"test":"mocha 'test/**/*.{js,ts}'","build":"npm run build:rollup && npm run build:ts","lint:ts":"tsc --noEmit true","build:ts":"cp lib/index.d.ts dist/cjs/index.d.cts && cp lib/sync.d.ts dist/cjs/sync.d.cts && cp lib/*.ts dist/esm","lint:fix":"eslint --fix","lint:check":"eslint","preversion":"npm run build && git add dist","test:legacy":"mocha --ignore test/api.web_stream.js --ignore test/api.web_stream.ts --ignore test/api.stream.finished.ts --ignore test/api.stream.iterator.ts 'test/**/*.{js,ts}'","build:rollup":"npx rollup -c","postbuild:ts":"find dist/cjs -name '*.d.cts' -exec sh -c \"sed -i \"s/\\.js'/\\.cjs'/g\" {} || sed -i '' \"s/\\.js'/\\.cjs'/g\" {}\" \\;"},"_npmUser":{"name":"david","email":"david@adaltas.com"},"repository":{"url":"https://github.com/adaltas/node-csv.git","type":"git","directory":"packages/csv-parse"},"_npmVersion":"lerna/8.2.2/node@v22.17.0+x64 (linux)","description":"CSV parsing implementing the Node.js `stream.Transform` API","directories":{},"_nodeVersion":"22.17.0","typesVersions":{"*":{".":["dist/esm/index.d.ts"],"sync":["dist/esm/sync.d.ts"],"browser/esm":["dist/esm/index.d.ts"],"browser/esm/sync":["dist/esm/sync.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"pad":"^3.3.0","each":"^2.7.2","mocha":"^11.5.0","dedent":"^1.6.0","rollup":"^4.41.1","should":"^13.2.3","ts-node":"^10.9.2","prettier":"^3.5.3","typescript":"^5.8.3","@types/node":"^22.15.30","@types/mocha":"^10.0.10","csv-generate":"^4.5.0","csv-spectrum":"^2.0.0","stream-transform":"^3.4.0","rollup-plugin-node-globals":"^1.4.0","@rollup/plugin-node-resolve":"^16.0.1","rollup-plugin-node-builtins":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/csv-parse_6.1.0_1752691340751_0.8346133612048667","host":"s3://npm-registry-packages-npm-production"},"readme":"# CSV parser for Node.js and the web\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/adaltas/node-csv/nodejs.yml?branch=master)](https://github.com/adaltas/node-csv/actions)\n[![NPM](https://img.shields.io/npm/dm/csv-parse)](https://www.npmjs.com/package/csv-parse)\n[![NPM](https://img.shields.io/npm/v/csv-parse)](https://www.npmjs.com/package/csv-parse)\n\nThe [`csv-parse` package](https://csv.js.org/parse/) is a parser converting CSV text input into arrays or objects. It is part of the [CSV project](https://csv.js.org/).\n\nIt implements the Node.js [`stream.Transform` API](http://nodejs.org/api/stream.html#stream_class_stream_transform). It also provides a simple callback-based API for convenience. It is both extremely easy to use and powerful. It was first released in 2010 and is used against big data sets by a large community.\n\n## Documentation\n\n- [Project homepage](https://csv.js.org/parse/)\n- [API](https://csv.js.org/parse/api/)\n- [Options](https://csv.js.org/parse/options/)\n- [Info properties](https://csv.js.org/parse/info/)\n- [Common errors](https://csv.js.org/parse/errors/)\n- [Examples](https://csv.js.org/project/examples/)\n\n## Main features\n\n- Flexible with lot of [options](https://csv.js.org/parse/options/)\n- Multiple [distributions](https://csv.js.org/parse/distributions/): Node.js, Web, ECMAScript modules and CommonJS\n- Follow the Node.js streaming API\n- Simplicity with the optional callback API\n- Support delimiters, quotes, escape characters and comments\n- Line breaks discovery\n- Support big datasets\n- Complete test coverage and lot of samples for inspiration\n- No external dependencies\n- Work nicely with the [csv-generate](https://csv.js.org/generate/), [stream-transform](https://csv.js.org/transform/) and [csv-stringify](https://csv.js.org/stringify/) packages\n- MIT License\n\n## Usage\n\nRun `npm install csv` to install the full CSV module or run `npm install csv-parse` if you are only interested by the CSV parser.\n\nUse the callback and sync APIs for simplicity or the stream based API for scalability.\n\n## Example\n\nThe [API](https://csv.js.org/parse/api/) is available in multiple flavors. This example illustrates the stream API.\n\n```js\nimport assert from \"assert\";\nimport { parse } from \"csv-parse\";\n\nconst records = [];\n// Initialize the parser\nconst parser = parse({\n  delimiter: \":\",\n});\n// Use the readable stream api to consume records\nparser.on(\"readable\", function () {\n  let record;\n  while ((record = parser.read()) !== null) {\n    records.push(record);\n  }\n});\n// Catch any error\nparser.on(\"error\", function (err) {\n  console.error(err.message);\n});\n// Test that the parsed records matched the expected records\nparser.on(\"end\", function () {\n  assert.deepStrictEqual(records, [\n    [\"root\", \"x\", \"0\", \"0\", \"root\", \"/root\", \"/bin/bash\"],\n    [\"someone\", \"x\", \"1022\", \"1022\", \"\", \"/home/someone\", \"/bin/bash\"],\n  ]);\n});\n// Write data to the stream\nparser.write(\"root:x:0:0:root:/root:/bin/bash\\n\");\nparser.write(\"someone:x:1022:1022::/home/someone:/bin/bash\\n\");\n// Close the readable stream\nparser.end();\n```\n\n## Contributors\n\nThe project is sponsored by [Adaltas](https://www.adaltas.com), an Big Data consulting firm based in Paris, France.\n\n- David Worms: <https://github.com/wdavidw>\n","publish_time":1752691340965,"_cnpm_publish_time":1752691340965,"dist-tags":{"latest":"7.0.3"}}