{"_id":"@danko16/fastify-file-upload","name":"@danko16/fastify-file-upload","dist-tags":{"latest":"4.0.1"},"versions":{"4.0.1":{"name":"@danko16/fastify-file-upload","version":"4.0.1","description":"file upload plugin for Fastify","main":"index.js","scripts":{"test":"tap test/*.test.js"},"repository":{"type":"git","url":"git+https://github.com/huangang/fastify-file-upload.git"},"keywords":["fastify","fileUpload","multipart","form"],"author":{"name":"huangang","email":"huangang.zhang@gmail.com"},"license":"MIT","dependencies":{"@types/node":"^16.11.0","express-fileupload":"^1.3.1","fastify-plugin":"^3.0.1","middie":"^6.0.0"},"devDependencies":{"fastify":"^3.28.0","form-data":"^4.0.0","pump":"^3.0.0","tap":"^16.0.1"},"_id":"@danko16/fastify-file-upload@4.0.1","gitHead":"082b3732f885d824ce42ad5ff3aa81615126f01c","bugs":{"url":"https://github.com/huangang/fastify-file-upload/issues"},"homepage":"https://github.com/huangang/fastify-file-upload#readme","_nodeVersion":"18.18.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-rY/FpiNQUM38mnPn2A1JVgmo0yWev7tn0/uAjWc9zPeFYCmPUorQxIGeym8uHJWBrkRQMUX8WcsyhE5G0DEtnQ==","shasum":"648bfd64311e7643da30a1a4679b5ee77bff8730","tarball":"https://registry.npmjs.org/@danko16/fastify-file-upload/-/fastify-file-upload-4.0.1.tgz","fileCount":9,"unpackedSize":9776,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID5nW+8ikECuYITE7s91LLalRCZ/UVaZgDcIYNdg6bCBAiA6cJC5/TBRc2PW6JhQskhllZc28g+O0QqKbDQqWAbGZg=="}]},"_npmUser":{"name":"danko16","email":"dankoproj@gmail.com"},"directories":{},"maintainers":[{"name":"danko16","email":"dankoproj@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fastify-file-upload_4.0.1_1703705092302_0.9066604045539823"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-27T19:24:52.187Z","4.0.1":"2023-12-27T19:24:52.450Z","modified":"2023-12-27T19:24:52.728Z"},"maintainers":[{"name":"danko16","email":"dankoproj@gmail.com"}],"description":"file upload plugin for Fastify","homepage":"https://github.com/huangang/fastify-file-upload#readme","keywords":["fastify","fileUpload","multipart","form"],"repository":{"type":"git","url":"git+https://github.com/huangang/fastify-file-upload.git"},"author":{"name":"huangang","email":"huangang.zhang@gmail.com"},"bugs":{"url":"https://github.com/huangang/fastify-file-upload/issues"},"license":"MIT","readme":"# fastify-file-upload\n\nFastify plugin to upload file.\n\n[![Build Status](https://travis-ci.org/huangang/fastify-file-upload.svg?branch=master)](https://travis-ci.org/huangang/fastify-file-upload)\n[![NPM version](https://img.shields.io/npm/v/fastify-file-upload.svg?style=flat)](https://www.npmjs.com/package/fastify-file-upload)\n\n__Note: the v3.x series of this module covers Fastify v3. For Fastify v2 support refert to the v2.x series.__\n\n## Install\n```\nnpm i fastify-file-upload --save\n```\n## Usage\n\n```js\n'use strict'\n\nconst fastify = require('fastify')()\nconst fileUpload = require('fastify-file-upload')\n\nfastify.register(fileUpload)\n\nfastify.post('/upload', function (req, reply) {\n  // some code to handle file\n  const files = req.raw.files\n  console.log(files)\n  let fileArr = []\n  for(let key in files){\n    fileArr.push({\n      name: files[key].name,\n      mimetype: files[key].mimetype\n    })\n  }\n  reply.send(fileArr)\n})\n\nfastify.listen(3000, err => {\n  if (err) throw err\n  console.log(`server listening on ${fastify.server.address().port}`)\n})\n```\n## Use Schema Demo (fastify version >= 2)\n``` js\nfastify.post('/uploadSchema', {\n  schema: {\n    summary: 'upload file',\n    body: {\n      type: 'object',\n      properties: {\n        file: { type: 'object' }\n      },\n      required: ['file']\n    }\n  },\n  handler: (request, reply) => {\n    const file = request.body.file\n    console.log(file)\n    reply.send({ file })\n  }\n})\n```\n\n## Using Busboy Options\n```js\nfastify.register(fileUpload, {\n  limits: { fileSize: 50 * 1024 * 1024 },\n});\n```\n### [Available Options](https://github.com/richardgirges/express-fileupload#available-options)\n","readmeFilename":"README.md"}