{"_id":"@blubox/multer","_rev":"4-714ff8184dd2c61992d14c0d86d27dff","name":"@blubox/multer","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.1":{"name":"@blubox/multer","version":"0.0.1","description":"Blubox multer","main":"./dist/index.js","module":"./dist/index.mjs","repository":{"type":"git","url":"git+https://github.com/gnzcode/blubox.git"},"private":false,"publishConfig":{"access":"public"},"author":{"name":"Gnzcode","email":"contact@gnzcode.com"},"homepage":"https://github.com/gnzcode/blubox/tree/main/docs","license":"MIT","keywords":["multer","blubox-multer","blubox","@blubox/multer"],"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --minify terser","prepublishOnly":"npm run build"},"devDependencies":{"@types/formidable":"^3.4.3","terser":"^5.21.0","tsup":"^7.2.0","typescript":"^5.2.2"},"peerDependencies":{"blubox":">=0.0.1"},"dependencies":{"formidable":"^3.5.1"},"_id":"@blubox/multer@0.0.1","gitHead":"059535a6880dc1f66c6cab550ef062477ff2e82f","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/gnzcode/blubox/issues"},"_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-Eve0yP3lGHvp4EJF/vVWpW+6css4U/0TvcBmy2jetvPqTgROrUUa9rkeyLjwslVCqxqiZ1zdNbHk/bk4FFcZeg==","shasum":"33efb4360624c33e0e324a80df084cdb5e3ecde7","tarball":"https://registry.npmjs.org/@blubox/multer/-/multer-0.0.1.tgz","fileCount":6,"unpackedSize":11264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHP9F8GZMztcQ1I0DGnkp44zLjBxizevxkP6vTiL6VBQIgWXvAMgmp7C7NlGmKJ+BSk70EiPjYJ8YgKSt9GizpIwg="}]},"_npmUser":{"name":"gnzcode","email":"gnzcode@gmail.com"},"directories":{},"maintainers":[{"name":"gnzcode","email":"gnzcode@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/multer_0.0.1_1697594218566_0.047452250250643147"},"_hasShrinkwrap":false},"0.0.2":{"name":"@blubox/multer","version":"0.0.2","description":"Blubox multer","main":"./dist/index.js","module":"./dist/index.mjs","repository":{"type":"git","url":"git+https://github.com/gnzcode/blubox.git"},"private":false,"publishConfig":{"access":"public"},"author":{"name":"Gnzcode","email":"contact@gnzcode.com"},"homepage":"https://github.com/gnzcode/blubox/tree/main/docs","license":"MIT","keywords":["multer","blubox-multer","blubox","@blubox/multer"],"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --minify terser","prepublishOnly":"npm run build"},"devDependencies":{"@types/formidable":"^3.4.3","terser":"^5.21.0","tsup":"^7.2.0","typescript":"^5.2.2"},"peerDependencies":{"blubox":">=0.0.1"},"dependencies":{"formidable":"^3.5.1"},"_id":"@blubox/multer@0.0.2","gitHead":"059535a6880dc1f66c6cab550ef062477ff2e82f","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/gnzcode/blubox/issues"},"_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-u+UqrkHcIm3S5l2mMaIkckA3s77wwt25uQM1c4jAIsVDVE4lyKmi51LCLrX+F3bod27rWCsvHy9pUZ3qrq1Yuw==","shasum":"ab65fc5251a38279eb65ce76f72d63abfd772c12","tarball":"https://registry.npmjs.org/@blubox/multer/-/multer-0.0.2.tgz","fileCount":6,"unpackedSize":11442,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF8Qp+4p/E44gGbqrfvCKiVC5/BGbxA1PVpP3RznXZx+AiEA9s5frW7f0Jb5IGuthLbXeG1TjmQW7yMshegEKt2KIfw="}]},"_npmUser":{"name":"gnzcode","email":"gnzcode@gmail.com"},"directories":{},"maintainers":[{"name":"gnzcode","email":"gnzcode@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/multer_0.0.2_1697595265364_0.03545561184757773"},"_hasShrinkwrap":false},"0.0.3":{"name":"@blubox/multer","version":"0.0.3","description":"Blubox multer","main":"./dist/index.js","module":"./dist/index.mjs","repository":{"type":"git","url":"git+https://github.com/gnzcode/blubox.git"},"private":false,"publishConfig":{"access":"public"},"author":{"name":"Gnzcode","email":"contact@gnzcode.com"},"homepage":"https://github.com/gnzcode/blubox/tree/main/docs","license":"MIT","keywords":["multer","blubox-multer","blubox","@blubox/multer"],"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --minify terser","prepublishOnly":"npm run build"},"devDependencies":{"@types/formidable":"^3.4.3","terser":"^5.21.0","tsup":"^7.2.0","typescript":"^5.2.2"},"peerDependencies":{"blubox":">=0.2.0"},"dependencies":{"formidable":"^3.5.1"},"_id":"@blubox/multer@0.0.3","gitHead":"62a948f3a3f7657964287bbf20c3596b38d68d32","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/gnzcode/blubox/issues"},"_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-SrsrC0D2OUcqa3Uzg/IkwaDm8JZWa3tqZPIt9QVD22zU/pHUo9gz+hnKi7XiwZFSwsKOb1CznTSTlowU5KcJEA==","shasum":"a38892539e7bd0a32bc95c3eb2e9b6c7b035f1fa","tarball":"https://registry.npmjs.org/@blubox/multer/-/multer-0.0.3.tgz","fileCount":6,"unpackedSize":11364,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/foCC3Gn11Zi3vgafgY9OMBkUDdFhkTBJDkgioI0m9AiA9D4koprPtvNlRJ3VlxuSi2lz5m2nQRcYpjZNPq+GTeA=="}]},"_npmUser":{"name":"gnzcode","email":"gnzcode@gmail.com"},"directories":{},"maintainers":[{"name":"gnzcode","email":"gnzcode@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/multer_0.0.3_1698264961750_0.49053408855628766"},"_hasShrinkwrap":false},"1.0.0":{"name":"@blubox/multer","version":"1.0.0","description":"Blubox multer","keywords":["multer","blubox-multer","blubox","@blubox/multer"],"main":"./dist/index.js","module":"./dist/index.mjs","repository":{"type":"git","url":"git+https://github.com/gnzcode/blubox.git"},"author":{"name":"Gnzcode","email":"contact@gnzcode.com"},"license":"MIT","homepage":"https://bluboxs.com/","private":false,"publishConfig":{"access":"public"},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --minify terser","prepublishOnly":"npm run build"},"peerDependencies":{"blubox":">=1.0.1"},"_id":"@blubox/multer@1.0.0","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/gnzcode/blubox/issues"},"_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-4D+Y5L90qu2c8VD59bQeynUL10Ogk/59rjzkLwA1AZpaIKbb39T88U01vOXIxM9HLlMG4Aq711gp4DipUT5seA==","shasum":"f9c59ee0d4ccf1062293b4965646159d53798efc","tarball":"https://registry.npmjs.org/@blubox/multer/-/multer-1.0.0.tgz","fileCount":6,"unpackedSize":60712,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbWd2dN2tu1bYQOPaVsCm5+8ijc/T7PRE7bkKrFYjCPwIhAJA3R1pqBgHjkOR8cTSFoT3aTz8IAmjke/A+RpjSJTZb"}]},"_npmUser":{"name":"gnzcode","email":"gnzcode@gmail.com"},"directories":{},"maintainers":[{"name":"gnzcode","email":"gnzcode@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/multer_1.0.0_1702238245519_0.7036605679951362"},"_hasShrinkwrap":false},"1.0.1":{"name":"@blubox/multer","version":"1.0.1","description":"Blubox multer","keywords":["multer","blubox-multer","blubox","@blubox/multer"],"main":"./dist/index.js","module":"./dist/index.mjs","repository":{"type":"git","url":"git+https://github.com/gnzcode/blubox.git"},"author":{"name":"Gnzcode","email":"contact@gnzcode.com"},"license":"MIT","homepage":"https://bluboxs.com/","private":false,"publishConfig":{"access":"public"},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --minify terser","prepublishOnly":"npm run build"},"peerDependencies":{"blubox":">=1.0.1"},"_id":"@blubox/multer@1.0.1","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/gnzcode/blubox/issues"},"_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-biZv+NfyyCM78TzfLj38QEHyOBbSD5TOcL/YA3VgXu4ooMnEx1upUeJOIwqNoEaHZ6GtiNOl8NnfEQ18kV+1WA==","shasum":"8ed94f7fa3f69221d6aa4a8ea2f6fc30c4aa1f06","tarball":"https://registry.npmjs.org/@blubox/multer/-/multer-1.0.1.tgz","fileCount":6,"unpackedSize":56939,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGAABegM63bEsBL/GDFuPOu//xl05u5vIy+QabsYu9UUAiBjhOUsfjSm7hsQVcp0hHSSBrj9wmnq/dLbp5Pw3jKA0A=="}]},"_npmUser":{"name":"gnzcode","email":"gnzcode@gmail.com"},"directories":{},"maintainers":[{"name":"gnzcode","email":"gnzcode@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/multer_1.0.1_1702401670249_0.9691674305711537"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-18T01:56:58.498Z","0.0.1":"2023-10-18T01:56:58.844Z","modified":"2023-12-12T17:21:10.677Z","0.0.2":"2023-10-18T02:14:25.514Z","0.0.3":"2023-10-25T20:16:02.105Z","1.0.0":"2023-12-10T19:57:25.693Z","1.0.1":"2023-12-12T17:21:10.485Z"},"maintainers":[{"name":"gnzcode","email":"gnzcode@gmail.com"}],"description":"Blubox multer","homepage":"https://bluboxs.com/","keywords":["multer","blubox-multer","blubox","@blubox/multer"],"repository":{"type":"git","url":"git+https://github.com/gnzcode/blubox.git"},"author":{"name":"Gnzcode","email":"contact@gnzcode.com"},"bugs":{"url":"https://github.com/gnzcode/blubox/issues"},"license":"MIT","readme":"# Multer Middleware\r\n\r\nA middleware for handling file uploads in your web server.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @blubox/multer\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\n\r\nconst multer, { Options, File, Storage } = require('@blubox/multer')\r\nconst { Controller } = require('blubox')\r\n\r\n// Define storage options\r\nconst storageOptions = {\r\n  destination: './uploads',\r\n  filename: (ctx, file) => `${Date.now()}-${file.originalname}`\r\n};\r\n\r\n// Initialize storage\r\nconst storage = new Storage(storageOptions);\r\n\r\n// Define multer options\r\nconst multerOptions: Options = {\r\n  fields: ['image', 'document'],\r\n  extnames: ['.jpg', '.png', '.pdf'],\r\n  storage: storage\r\n};\r\n\r\n// Create the multer middleware\r\nconst multerMiddleware = multer(multerOptions);\r\n\r\nconst controller = new Controller()\r\ncontroller.use(multerMiddleware)\r\n```\r\n\r\n## Options\r\n\r\n`fields`: Array of field names or objects with name and maxCount properties.\r\n`extnames`: Array of allowed file extensions.\r\n`storage`: Instance of the Storage class.\r\n\r\n## Storage Class\r\n\r\nThe Storage class provides methods for creating filenames, destinations, and paths based on user-defined functions or strings.\r\n\r\n```js\r\nconst storage = new Storage({\r\n\tdestination: (ctx, file) => './uploads',\r\n\tfilename: (ctx, file) => `${Date.now()}-${file.originalname}`,\r\n})\r\n```\r\n\r\n## License\r\n\r\n[MIT](https://github.com/gnzcode/blubox/blob/main/LICENSE.md)\r\n","readmeFilename":"README.md"}