{"_id":"@a-drowned-fish/multer-cos","_rev":"6-3922ac3c39cfa8a709092ba637a34d10","name":"@a-drowned-fish/multer-cos","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@a-drowned-fish/multer-cos","version":"1.0.0","keywords":["multer","cos","node"],"author":{"name":"zhousuyang"},"license":"MIT","_id":"@a-drowned-fish/multer-cos@1.0.0","maintainers":[{"name":"a-drowned-fish","email":"18701717289@163.com"}],"dist":{"shasum":"41ea44fcae7a6eb0992528b9e0730c5db33eae30","tarball":"https://registry.npmjs.org/@a-drowned-fish/multer-cos/-/multer-cos-1.0.0.tgz","fileCount":6,"integrity":"sha512-ytkMwcp7DgW9WaNykq1o+mcsmap/L4GYM5PTmvNVfKicvTLIFtg1dXHARaB7+xP01oUF2w1ou3xqfSQuXN66sw==","signatures":[{"sig":"MEUCIQC5qp3FY8ge2bwJU6XJmhaholFCGCAjqoeWhJVYarvVdgIgGGA7goXJ4BUj59Y0qxuPQpDAlEmsud2TVm0By1tt7xI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8149},"main":"build/cjs/index.js","types":"build/index.d.ts","module":"build/es/index.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/es/index.js","default":"./build/cjs/index.js","require":"./build/cjs/index.js"},"./package.json":"./package.json"},"gitHead":"124350731a80992a1439a6f76ed77b8dd611c5b0","scripts":{},"_npmUser":{"name":"a-drowned-fish","email":"18701717289@163.com"},"repository":{"url":"https://gitee.com/alex-xueyao/multer-cos.git","type":"git"},"_npmVersion":"10.9.2","description":"A multer storage engine for Tencent Cloud Object Storage (COS)","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.40.1","typescript":"^5.8.3","@types/node":"^22.15.3","@types/multer":"^1.4.12","rollup-plugin-dts":"^6.2.1","@rollup/plugin-strip":"^3.0.4","rollup-plugin-delete":"^3.0.1","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-commonjs":"^28.0.3","@rollup/plugin-typescript":"^12.1.2","@rollup/plugin-node-resolve":"^16.0.1","rollup-plugin-node-externals":"^8.0.0"},"peerDependencies":{"tslib":"^2.8.1","cos-nodejs-sdk-v5":"^2.14.7"},"_npmOperationalInternal":{"tmp":"tmp/multer-cos_1.0.0_1746111391093_0.5741006058545663","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@a-drowned-fish/multer-cos","version":"1.0.1","keywords":["multer","cos","node"],"author":{"name":"zhousuyang"},"license":"MIT","_id":"@a-drowned-fish/multer-cos@1.0.1","maintainers":[{"name":"a-drowned-fish","email":"18701717289@163.com"}],"dist":{"shasum":"037affaf61b9a116ef53ce82adfe01fcb278576b","tarball":"https://registry.npmjs.org/@a-drowned-fish/multer-cos/-/multer-cos-1.0.1.tgz","fileCount":6,"integrity":"sha512-IIvhF9WWivTq9T2CS0YiVnLepA16rt7A8txbaAtwseqbwJrcJZTmy9lI1mtRx8nEPgI6fggVa82z0wXHXo1rgw==","signatures":[{"sig":"MEQCICBWY9Jx4+b6Y4U3XTC5T+Q71lafbU6V/TK8PtBH1a8yAiBdpXxQw80o2VMRruLAlfF7/HHmgtQKF/6tpcshPL8fVw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8269},"main":"build/cjs/index.js","types":"build/index.d.ts","module":"build/es/index.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/es/index.js","default":"./build/cjs/index.js","require":"./build/cjs/index.js"},"./package.json":"./package.json"},"gitHead":"d948a9332a3d744483899c572a50d2d3b94106bf","scripts":{},"_npmUser":{"name":"a-drowned-fish","email":"18701717289@163.com"},"repository":{"url":"https://gitee.com/alex-xueyao/multer-cos.git","type":"git"},"_npmVersion":"10.9.2","description":"A multer storage engine for Tencent Cloud Object Storage (COS)","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.40.1","typescript":"^5.8.3","@types/node":"^22.15.3","@types/multer":"^1.4.12","rollup-plugin-dts":"^6.2.1","@rollup/plugin-strip":"^3.0.4","rollup-plugin-delete":"^3.0.1","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-commonjs":"^28.0.3","@rollup/plugin-typescript":"^12.1.2","@rollup/plugin-node-resolve":"^16.0.1","rollup-plugin-node-externals":"^8.0.0"},"peerDependencies":{"tslib":"^2.8.1","cos-nodejs-sdk-v5":"^2.14.7"},"_npmOperationalInternal":{"tmp":"tmp/multer-cos_1.0.1_1746115568254_0.31184011882443974","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@a-drowned-fish/multer-cos","version":"1.0.2","keywords":["multer","cos","node"],"author":{"name":"zhousuyang"},"license":"MIT","_id":"@a-drowned-fish/multer-cos@1.0.2","maintainers":[{"name":"a-drowned-fish","email":"18701717289@163.com"}],"dist":{"shasum":"707a6ee1ca807951ebe8c271f0682e1c9a776dc0","tarball":"https://registry.npmjs.org/@a-drowned-fish/multer-cos/-/multer-cos-1.0.2.tgz","fileCount":6,"integrity":"sha512-tl7wT/EBKFHFACSJyG6vlgWi9sh9rPNN3hpLEVU5j13Se3ZELSuxIj/9XE4pw9P2wB6Kn3cZ/JD0Prrf4561Yg==","signatures":[{"sig":"MEQCIHewJAcTeIHWHQc82s523bzFnOz+X8unE9ue+ECBb78CAiAkUlu3rWXBOxEBZTWG1xOzy79GJYLYTa9ogTMk1FQU0w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8374},"main":"build/cjs/index.js","types":"build/index.d.ts","module":"build/es/index.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/es/index.js","default":"./build/cjs/index.js","require":"./build/cjs/index.js"},"./package.json":"./package.json"},"gitHead":"747183af4b7555c9ff18e28b3afe17c26decab14","scripts":{},"_npmUser":{"name":"a-drowned-fish","email":"18701717289@163.com"},"repository":{"url":"https://gitee.com/alex-xueyao/multer-cos.git","type":"git"},"_npmVersion":"10.9.2","description":"A multer storage engine for Tencent Cloud Object Storage (COS)","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.40.1","typescript":"^5.8.3","@types/node":"^22.15.3","@types/multer":"^1.4.12","rollup-plugin-dts":"^6.2.1","@rollup/plugin-strip":"^3.0.4","rollup-plugin-delete":"^3.0.1","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-commonjs":"^28.0.3","@rollup/plugin-typescript":"^12.1.2","@rollup/plugin-node-resolve":"^16.0.1","rollup-plugin-node-externals":"^8.0.0"},"peerDependencies":{"tslib":"^2.8.1","cos-nodejs-sdk-v5":"^2.14.7"},"_npmOperationalInternal":{"tmp":"tmp/multer-cos_1.0.2_1746115654364_0.7439141858291243","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@a-drowned-fish/multer-cos","version":"1.0.3","keywords":["multer","cos","node"],"author":{"name":"zhousuyang"},"license":"MIT","_id":"@a-drowned-fish/multer-cos@1.0.3","maintainers":[{"name":"a-drowned-fish","email":"18701717289@163.com"}],"dist":{"shasum":"8dfa8b05fe6c8dc662491ebcbb8a94d59d54ebc7","tarball":"https://registry.npmjs.org/@a-drowned-fish/multer-cos/-/multer-cos-1.0.3.tgz","fileCount":6,"integrity":"sha512-+FQxtr/UzcSpXX8DAZcosIo7u654H461G865qtJ7MWLzwBKgnztwAutCOq87IAo+wErGK50N20i15ViPzRSsNA==","signatures":[{"sig":"MEYCIQDb2vYRZ2FXVNSYVaxcVXpV8v/ZmAbHSJokeG0VXDtrEQIhAPO3VqsA2OuRnJ9rbXjjPe9XxfTeIcU2851hz9EU9Yb9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8713},"main":"build/cjs/index.js","types":"build/index.d.ts","module":"build/es/index.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/es/index.js","default":"./build/cjs/index.js","require":"./build/cjs/index.js"},"./package.json":"./package.json"},"gitHead":"5ff52196d41f271cdb7057b9f704ba5f25fae885","scripts":{},"_npmUser":{"name":"a-drowned-fish","email":"18701717289@163.com"},"repository":{"url":"https://gitee.com/alex-xueyao/multer-cos.git","type":"git"},"_npmVersion":"10.9.2","description":"A multer storage engine for Tencent Cloud Object Storage (COS)","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.40.1","typescript":"^5.8.3","@types/node":"^22.15.3","@types/multer":"^1.4.12","rollup-plugin-dts":"^6.2.1","@rollup/plugin-strip":"^3.0.4","rollup-plugin-delete":"^3.0.1","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-commonjs":"^28.0.3","@rollup/plugin-typescript":"^12.1.2","@rollup/plugin-node-resolve":"^16.0.1","rollup-plugin-node-externals":"^8.0.0"},"peerDependencies":{"tslib":"^2.8.1","cos-nodejs-sdk-v5":"^2.14.7"},"_npmOperationalInternal":{"tmp":"tmp/multer-cos_1.0.3_1746117180367_0.16521307216028913","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@a-drowned-fish/multer-cos","version":"1.0.4","keywords":["multer","cos","node"],"author":{"name":"zhousuyang"},"license":"MIT","_id":"@a-drowned-fish/multer-cos@1.0.4","maintainers":[{"name":"a-drowned-fish","email":"18701717289@163.com"}],"dist":{"shasum":"c39d1ccccea2400cfb93288033f99b03cf8d17c5","tarball":"https://registry.npmjs.org/@a-drowned-fish/multer-cos/-/multer-cos-1.0.4.tgz","fileCount":6,"integrity":"sha512-oae0lWSq1+1h87lOEoAWcchaq9ygzxWXKwcBirhl1hkWbc52NCNPIIaMFd0rJwQ67+l3n0II38y96Aln/SqTsw==","signatures":[{"sig":"MEQCIGAx1G/LEmeZSvrTT2kiUzVE25OLVPolpNtIA6H6suKkAiAQuWhB9Xp+Pkjoqev7hsBII4lk85mAGEe8gDTFNhM7+w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8900},"main":"build/cjs/index.js","types":"build/index.d.ts","module":"build/es/index.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/es/index.js","default":"./build/cjs/index.js","require":"./build/cjs/index.js"},"./package.json":"./package.json"},"gitHead":"4830e25b7262c7d7b12e68bfe3cd47b6d218c080","scripts":{},"_npmUser":{"name":"a-drowned-fish","email":"18701717289@163.com"},"repository":{"url":"https://gitee.com/alex-xueyao/multer-cos.git","type":"git"},"_npmVersion":"10.9.2","description":"A multer storage engine for Tencent Cloud Object Storage (COS)","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.40.1","typescript":"^5.8.3","@types/node":"^22.15.3","@types/multer":"^1.4.12","rollup-plugin-dts":"^6.2.1","@rollup/plugin-strip":"^3.0.4","rollup-plugin-delete":"^3.0.1","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-commonjs":"^28.0.3","@rollup/plugin-typescript":"^12.1.2","@rollup/plugin-node-resolve":"^16.0.1","rollup-plugin-node-externals":"^8.0.0"},"peerDependencies":{"tslib":"^2.8.1","cos-nodejs-sdk-v5":"^2.14.7"},"_npmOperationalInternal":{"tmp":"tmp/multer-cos_1.0.4_1746117934058_0.6581551018591092","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@a-drowned-fish/multer-cos","version":"1.0.5","description":"A multer storage engine for Tencent Cloud Object Storage (COS)","main":"build/cjs/index.js","module":"build/es/index.js","types":"build/index.d.ts","exports":{".":{"require":"./build/cjs/index.js","import":"./build/es/index.js","default":"./build/cjs/index.js","types":"./build/index.d.ts"},"./package.json":"./package.json"},"scripts":{},"repository":{"type":"git","url":"https://gitee.com/alex-xueyao/multer-cos.git"},"keywords":["multer","cos","node"],"author":{"name":"zhousuyang"},"license":"MIT","devDependencies":{"@rollup/plugin-commonjs":"^28.0.3","@rollup/plugin-node-resolve":"^16.0.1","@rollup/plugin-strip":"^3.0.4","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^12.1.2","@types/multer":"^1.4.12","@types/node":"^22.15.3","rollup":"^4.40.1","rollup-plugin-delete":"^3.0.1","rollup-plugin-dts":"^6.2.1","rollup-plugin-node-externals":"^8.0.0","typescript":"^5.8.3"},"peerDependencies":{"cos-nodejs-sdk-v5":"^2.14.7","tslib":"^2.8.1"},"_id":"@a-drowned-fish/multer-cos@1.0.5","gitHead":"9410f72d20162f23c931ba7eb3e3b600f0e17728","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Z7jQiLti22+zEH12jFchMC9JbRmvb7gQV6tFHWbOD0mA4R5vUfaJvBVX/aQXefig578TxKFL3T9kChI/kupz3A==","shasum":"43f56e7ce5b05abed8b7540b947d0cad5e2456fa","tarball":"https://registry.npmjs.org/@a-drowned-fish/multer-cos/-/multer-cos-1.0.5.tgz","fileCount":6,"unpackedSize":9687,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFKkMCtTmAqyz7KPRvIKL3oBy47YDBsc8kLFsEXLtaYCAiEA89U1rReRgjZMzw2YepAuZJ7g0TvUCeHYVNFnYXSENJU="}]},"_npmUser":{"name":"a-drowned-fish","email":"18701717289@163.com"},"directories":{},"maintainers":[{"name":"a-drowned-fish","email":"18701717289@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/multer-cos_1.0.5_1746140885696_0.9725132851946734"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-01T14:56:30.977Z","modified":"2025-05-01T23:08:06.171Z","1.0.0":"2025-05-01T14:56:31.300Z","1.0.1":"2025-05-01T16:06:08.438Z","1.0.2":"2025-05-01T16:07:34.536Z","1.0.3":"2025-05-01T16:33:00.543Z","1.0.4":"2025-05-01T16:45:34.262Z","1.0.5":"2025-05-01T23:08:05.973Z"},"author":{"name":"zhousuyang"},"license":"MIT","keywords":["multer","cos","node"],"repository":{"type":"git","url":"https://gitee.com/alex-xueyao/multer-cos.git"},"description":"A multer storage engine for Tencent Cloud Object Storage (COS)","maintainers":[{"name":"a-drowned-fish","email":"18701717289@163.com"}],"readme":"# Multer Storage Engine for Tencent Cloud Object Storage (COS)\n\n## Install\n\n```shell\nnpm install @a-drowned-fish/multer-cos\n```\n\n## Usage\n\n```javascript\nvar express = require('express')\nvar router = express.Router()\nconst multer = require('multer')\nconst { multerCosStorage } = require('@a-drowned-fish/multer-cos')\n\nconst storage = multerCosStorage({\n\tconfig: {\n\t\tSecretId: 'xxxxxx',\n\t\tSecretKey: 'pppppppp',\n\t\tBucket: 'ddddddd',\n\t\tRegion: 'fffffff',\n\t},\n\tdestination: 'nnnnn',\n})\n\nconst upload = multer({\n\tstorage: storage,\n})\n\nconst singleFileUpload = upload.single('file')\n\nrouter.post('/upload', (req, res) => {\n\ttry {\n\t\tsingleFileUpload(req, res, (error) => {\n\t\t\tif (error) {\n\t\t\t\treturn res.json({ msg: 'fail' })\n\t\t\t}\n\t\t\t// req.file.filepath -> used to delete file from COS\n\t\t\tconsole.log(req.file, req.file.filepath, req.file.url, req.file.destination, req.file.filename)\n\t\t\tres.json({ msg: 'success' })\n\t\t})\n\t} catch (error) {\n\t\tres.json({ msg: 'fail' })\n\t}\n})\n// or\nrouter.post('/upload', singleFileUpload, (req, res) => {\n\ttry {\n\t\t// req.file.filepath -> used to delete file from COS\n\t\tconsole.log(req.file, req.file.filepath, req.file.url, req.file.destination, req.file.filename)\n\t\tres.json({ msg: 'success' })\n\t} catch (error) {\n\t\tres.json({ msg: 'fail' })\n\t}\n})\n\n// delete file from COS\nrouter.delete('/:id', (req, res) => {\n\t// ......\n\tstorage.deleteFile('filepath')\n})\n\nmodule.exports = router\n\n```\n","readmeFilename":"README.md"}