{"_id":"@autotelic/fastify-stream-to-csv","_rev":"2-acaaef2091ca1eb51d892b07cf8d93a1","name":"@autotelic/fastify-stream-to-csv","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@autotelic/fastify-stream-to-csv","version":"0.1.0","description":"Stream CSVs from Fastify routes","main":"index.js","directories":{"test":"test"},"scripts":{"test":"c8 --100 ava","lint":"standard","fix":"standard --fix","validate":"npm run lint && npm run test"},"repository":{"type":"git","url":"git+https://github.com/autotelic/fastify-stream-to-csv.git"},"keywords":[],"author":{"name":"Autotelic Development Ltd","email":"hello@autotelic.com"},"license":"MIT","bugs":{"url":"https://github.com/autotelic/fastify-stream-to-csv/issues"},"homepage":"https://github.com/autotelic/fastify-stream-to-csv#readme","dependencies":{"@fast-csv/format":"^4.3.5","fastify-plugin":"^3.0.0"},"devDependencies":{"ava":"^4.0.1","c8":"^7.10.0","csv-parse":"^5.0.4","fastify":"^3.0.0","fastify-cli":"^2.15.0","husky":"^7.0.4","lint-staged":"^12.1.2","pg":"^8.7.3","pg-query-stream":"^4.2.3","standard":"^16.0.3","supertest":"^6.2.2","typesense":"^1.1.3"},"lint-staged":{"*.{js,jsx}":["npm run fix"]},"gitHead":"be4bf0fb384998fa882dbc870c1043ea2e777ce8","_id":"@autotelic/fastify-stream-to-csv@0.1.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-6sWx/9zIvbUXPyMiBx9IsrasesGnmD5CVexvbaCaF//HlQWn/khcboOlu636zefvcMCkSE/fX81QNpRNwOJ+Zw==","shasum":"b20abcca0e841f3a4923df0e327aa0f50fef4d07","tarball":"https://registry.npmjs.org/@autotelic/fastify-stream-to-csv/-/fastify-stream-to-csv-0.1.0.tgz","fileCount":15,"unpackedSize":12836,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIACE7bFDH3/JT8Cyo4oIG9EVlcW9Xi9r/8BC6It/0cTeAiBznFV1izGTGQ1E58dIw8shwGLcDmQLvn9jzJaXOE58nw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaa+8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9/RAAl8M2RvE52UAJg7c3SgtCYvHYpjGTZpED0vpTxW9hUWO7r8av\r\nfZCKJ1WxKRAHNDYpyLs9b4sbF8y045Kx8TT6KRgV+VE/WqDwPQB2lTOaJ002\r\nG6E8O33CsB45oT2TA+0qlbm+FjamLgRVmX9kaIzRbL/dLtL6yXyPPO2cGEH7\r\n6evbTjQqRIQrIfugFknNTwApfgK237kBODi0PghNgqPiDybsxYZA2q7zPFXS\r\nUhNKtQ+szBfiX2+lsInHiWLde9Pv+rZ+42cQFqZW31rKbSBDq5xYRzSDNPLq\r\nJdnrI/l5KXUiL3CPFvZmbu6tDnZU2aKiIi6DpM2TvECVVfikoRzbVybkBSjs\r\nQ+sTd+XK0ce7r5MFDhfKdrddGxb5z8I+naU84ZIaGvqW1jaYJAvxQyWH/DTg\r\niirNbrK0RmvqeFBb9UFiJm4f+/R0uTXgMFdFK70JT8xObZd8oXhvCHlCaXOu\r\npimdPaov9WDfYQbwxdaEKFQxLNk1vMnBJpNzUQ2eBFMddgQo+z1Iwc+MqKLc\r\nUDHDchrQLEYS8VyY0/Fn/7fxQul5lmB6vfOVVz1JkZTs9kmFL8UsYngg1nog\r\nJieimtby/FbTp368vQCdmcRyIQgf4+zJPYFzMawcWCpJpe6yraJQJvV2+pHZ\r\nDIieOV/Rf1vU7TsL93MSrRPtRdLmh05Et8E=\r\n=9mHu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"autotelic","email":"info+npm@autotelic.com"},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fastify-stream-to-csv_0.1.0_1651093436270_0.5154871941160155"},"_hasShrinkwrap":false},"0.2.0":{"name":"@autotelic/fastify-stream-to-csv","version":"0.2.0","description":"Stream CSVs from Fastify routes","main":"index.js","directories":{"test":"test"},"scripts":{"test":"c8 --100 ava","lint":"standard","fix":"standard --fix","validate":"npm run lint && npm run test"},"repository":{"type":"git","url":"git+https://github.com/autotelic/fastify-stream-to-csv.git"},"keywords":[],"author":{"name":"Autotelic Development Ltd","email":"hello@autotelic.com"},"license":"MIT","bugs":{"url":"https://github.com/autotelic/fastify-stream-to-csv/issues"},"homepage":"https://github.com/autotelic/fastify-stream-to-csv#readme","dependencies":{"@fast-csv/format":"^4.3.5","fastify-plugin":"^3.0.0"},"devDependencies":{"ava":"^4.0.1","c8":"^7.10.0","csv-parse":"^5.0.4","fastify":"^4.10.2","fastify-cli":"^5.7.0","husky":"^8.0.2","lint-staged":"^13.1.0","pg":"^8.7.3","pg-query-stream":"^4.2.3","standard":"^17.0.0","supertest":"^6.2.2","typesense":"^1.1.3"},"lint-staged":{"*.{js,jsx}":["npm run fix"]},"gitHead":"e9303ca8bfff05951a64771a645fdb5fe5ed26ea","_id":"@autotelic/fastify-stream-to-csv@0.2.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-fqVK5sr3aDT2H7eqXuvYEoomo10BFnuC33i5YBBd2mYhzez0NbHNYnRzFbmq1GwohopK8d+udaBZ+97H3kyb5A==","shasum":"9e416063d9ea2619c69aa6780f087eef6567f260","tarball":"https://registry.npmjs.org/@autotelic/fastify-stream-to-csv/-/fastify-stream-to-csv-0.2.0.tgz","fileCount":16,"unpackedSize":12908,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC7VWjCXLEai6A+vCs+mvS+wFpvI4G2KxSa1wyP2+nQ4AiEArOnWVIWVXhEvQfDnPnDcLAa+HeDSL4MkAUlhidM1ZAQ="}]},"_npmUser":{"name":"autotelic","email":"info+npm@autotelic.com"},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fastify-stream-to-csv_0.2.0_1703112330399_0.7876949620628206"},"_hasShrinkwrap":false},"0.3.0":{"name":"@autotelic/fastify-stream-to-csv","version":"0.3.0","description":"Stream CSVs from Fastify routes","main":"index.js","types":"types/index.d.ts","engines":{"node":">=18"},"scripts":{"lint":"eslint .","test":"c8 --100 ava","test:types":"tsd","validate":"npm run lint && npm run test && npm run test:types"},"repository":{"type":"git","url":"git+https://github.com/autotelic/fastify-stream-to-csv.git"},"keywords":[],"author":{"name":"Autotelic Development Ltd","email":"hello@autotelic.com"},"license":"MIT","bugs":{"url":"https://github.com/autotelic/fastify-stream-to-csv/issues"},"homepage":"https://github.com/autotelic/fastify-stream-to-csv#readme","dependencies":{"@fast-csv/format":"^5.0.0","fastify-plugin":"^4.5.1"},"devDependencies":{"@autotelic/eslint-config-js":"^0.2.1","@types/node":"^20.11.2","@typescript-eslint/eslint-plugin":"^6.19.0","@typescript-eslint/parser":"^6.19.0","ava":"^6.0.1","c8":"^9.1.0","csv-parse":"^5.5.3","eslint":"^8.56.0","fastify":"^4.25.2","fastify-cli":"^6.0.1","pg":"^8.11.3","pg-query-stream":"^4.5.3","supertest":"^6.3.4","tsd":"^0.30.3","typesense":"^1.7.2"},"_id":"@autotelic/fastify-stream-to-csv@0.3.0","gitHead":"7fbcd895e84a4aa4d0b01cb8629419c4fd9c3fce","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-ejSEgf9aktXWitPEjnFR/09EIZfzdrobI4FpkdsPM5RQIEzLj7T3eCeltkikkzbFfRcKMlQW6qqoKfv/aEDq0w==","shasum":"362d9cde7d742c4c8694c3695dba2cae2e139320","tarball":"https://registry.npmjs.org/@autotelic/fastify-stream-to-csv/-/fastify-stream-to-csv-0.3.0.tgz","fileCount":5,"unpackedSize":4945,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHuOQEt3GrvfuwUo7lnfXqjVs7c9uD/5NV5/wfltUoN6AiBi4he6peQEupKnXqjA8HR4PTw4qsdUCFkI7mZWlfquow=="}]},"_npmUser":{"name":"autotelic","email":"info+npm@autotelic.com"},"directories":{},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fastify-stream-to-csv_0.3.0_1705359364712_0.7635310296487259"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-27T21:03:56.206Z","0.1.0":"2022-04-27T21:03:56.417Z","modified":"2024-01-15T22:56:05.031Z","0.2.0":"2023-12-20T22:45:30.637Z","0.3.0":"2024-01-15T22:56:04.851Z"},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"description":"Stream CSVs from Fastify routes","homepage":"https://github.com/autotelic/fastify-stream-to-csv#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/autotelic/fastify-stream-to-csv.git"},"author":{"name":"Autotelic Development Ltd","email":"hello@autotelic.com"},"bugs":{"url":"https://github.com/autotelic/fastify-stream-to-csv/issues"},"license":"MIT","readme":"# fastify-stream-to-csv\n\nStream CSVs from Fastify routes. Uses [fast-csv](https://c2fo.github.io/fast-csv/) for formatting.\n\n## Installation\n\n```sh\nnpm i -S @autotelic/fastify-stream-to-csv\n```\n\n## Usage\n\n```js\nconst { fastifyStreamToCsv } = require('@autotelic/fastify-stream-to-csv')\n\nconst fastify = Fastify()\n\nfastify.register(fastifyStreamToCsv)\n\nfastify.get('/report', async function (req, reply) {\n  // create a readable stream\n  const readStream = Readable.from(Array.from(Array(100000).keys()))\n\n  // create a row formatter\n  const rowFormatter = num => {\n    return [`a${num}`, `b${num}`, `c${num}`]\n  }\n\n  // these are fast-csv format options\n  const csvOptions = {\n    delimiter: '\\t',\n    headers: ['a', 'b', 'c']\n  }\n\n  // use reply decorator\n  await reply\n    .header('Content-disposition', 'attachment; filename=basic-example.csv')\n    .streamToCsv(readStream, rowFormatter, { csvOptions })\n\n  return reply\n}\n```\n\n## Github Actions/Workflows\n\n* Trigger the release workflow via release tag\n\n  ```sh\n  git checkout main && git pull\n  npm version { minor | major | path }\n  git push --follow-tags\n  ```\n","readmeFilename":"README.md"}