{"name":"csv-generate","version":"4.5.1","keywords":["stream","generate","csv","object","backend","frontend"],"author":{"url":"https://www.adaltas.com","name":"David Worms","email":"david@adaltas.com"},"license":"MIT","_id":"csv-generate@4.5.1","maintainers":[{"name":"david","email":"david@adaltas.com"}],"homepage":"https://csv.js.org/generate","bugs":{"url":"https://github.com/adaltas/node-csv-generate/issues"},"dist":{"shasum":"c0dc4fd32bfa46905cf6bc3747e4510f7a26d8d8","tarball":"http://registry-npm.ywwl.com/csv-generate/download/csv-generate-4.5.1.tgz","fileCount":29,"integrity":"sha512-nWVtFBfyK+YX1fHtKkMqzULc6sH5ise6baD64SmYTq3GEDSErVZ5xzyMa0hNP/a9PGJTTTyQTU69xpjcuCx2IA==","signatures":[{"sig":"MEQCIA24wLccbZFp+zrBl7hqac34AvdfIk0UQgUpsJAiZS02AiB/K21rXAP+bdGpN1pDhSgW4PsFBy57C1qwiRQ///0nXA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/csv-generate@4.5.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1184670,"size":257776,"noattachment":false,"key":"/csv-generate/-/csv-generate-4.5.1.tgz"},"main":"./dist/cjs/index.cjs","type":"module","mocha":{"import":"tsx","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":"bec87d1afd1f305d1a97103cf53a7cb72622d077","scripts":{"test":"npx tsc --noEmit && mocha 'test/**/*.{js,ts}'","build":"npm run build:rollup && npm run build:ts","lint:ts":"tsc --noEmit true","test:16":"mocha 'test/**/*.js'","build:ts":"cp lib/index.d.ts dist/cjs/index.d.cts && cp lib/stream.d.ts dist/cjs/stream.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 '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":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ecc8038-f757-4f4c-8746-eb2471a45575"}},"repository":{"url":"git+https://github.com/adaltas/node-csv.git","type":"git","directory":"packages/csv-generate"},"_npmVersion":"lerna/9.0.7/node@v24.14.0+x64 (linux)","description":"CSV and object generation implementing the Node.js `stream.Readable` API","directories":{},"_nodeVersion":"24.14.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":{"mocha":"^11.7.5","dedent":"^1.7.2","rollup":"^4.59.0","should":"~13.2.3","ts-node":"^10.9.2","prettier":"^3.8.1","typescript":"^5.9.3","@types/node":"^25.5.0","@types/mocha":"^10.0.10","rollup-plugin-node-globals":"^1.4.0","@rollup/plugin-node-resolve":"^16.0.3","rollup-plugin-node-builtins":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/csv-generate_4.5.1_1773770807767_0.7662274159285807","host":"s3://npm-registry-packages-npm-production"},"readme":"# CSV generator 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-generate)](https://www.npmjs.com/package/csv-generate)\n[![NPM](https://img.shields.io/npm/v/csv-generate)](https://www.npmjs.com/package/csv-generate)\n\nThe [`csv-generate` package](https://csv.js.org/generate/) provides a flexible generator of random CSV strings and Javascript objects implementing the Node.js `stream.Readable` API. It is part of the [CSV project](https://csv.js.org/).\n\n## Documentation\n\n- [Project homepage](https://csv.js.org/generate/)\n- [API](https://csv.js.org/generate/api/)\n- [Options](https://csv.js.org/generate/options/)\n- [Examples](https://csv.js.org/generate/examples/)\n\n## Main features\n\n- Scalable `stream.Readable` implementation\n- random or pseudo-random seed based generation\n- Idempotence with the \"seed\" option\n- User-defined value generation\n- Multiple types of values (integer, boolean, dates, ...)\n- MIT License\n\n## Usage\n\nRun `npm install csv` to install the full CSV module or run `npm install csv-generate` if you are only interested by the CSV generator.\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/generate/api/) is available in multiple flavors. This example illustrates the stream API.\n\n```js\nimport { generate } from \"csv-generate\";\nimport assert from \"assert\";\n\nconst records = [];\n// Initialize the generator\ngenerate({\n  seed: 1,\n  objectMode: true,\n  columns: 2,\n  length: 2,\n})\n  // Use the readable stream api to consume generated records\n  .on(\"readable\", function () {\n    let record;\n    while ((record = this.read()) !== null) {\n      records.push(record);\n    }\n  })\n  // Catch any error\n  .on(\"error\", function (err) {\n    console.error(err);\n  })\n  // Test that the generated records matched the expected records\n  .on(\"end\", function () {\n    assert.deepEqual(records, [\n      [\"OMH\", \"ONKCHhJmjadoA\"],\n      [\"D\", \"GeACHiN\"],\n    ]);\n  });\n```\n\n## Development\n\nTests are executed with [Mocha](https://mochajs.org/). To install it, simple run `npm install` followed by `npm test`. It will install mocha and its dependencies in your project \"node_modules\" directory and run the test suite. The tests run against the CoffeeScript source files.\n\nTo generate the JavaScript files, run `npm run coffee`.\n\nThe test suite is run online with [Travis](https://travis-ci.org/#!/adaltas/node-csv-generate). See the [Travis definition file](https://github.com/adaltas/node-csv-generate/blob/master/.travis.yml) to view the tested Node.js version.\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":1773770808001,"_cnpm_publish_time":1773770808001,"dist-tags":{"latest":"4.6.2"}}