{"_id":"multer-azure-blob-storage","_rev":"7-63fc098af16cdb2f4fce6497da3cba7f","name":"multer-azure-blob-storage","description":"ES5/6 & Typescript friendly multer storage engine for Azure's blob storage.","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"multer-azure-blob-storage","version":"1.0.0","description":"ES5/6 & Typescript friendly multer storage engine for Azure's blob storage.","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"lint":"tslint --project tsconfig.json","prebuild":"npm run lint","build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Sliverb/multer-azure-blob-storage.git"},"bugs":{"url":"https://github.com/Sliverb/multer-azure-blob-storage/issues"},"keywords":["multer","azure","express","file upload","azure storage","blob","typescript","ES5","ES6"],"author":{"name":"Bayo O"},"license":"MIT","private":false,"devDependencies":{"@types/multer":"^1.3.6","@types/node":"^6.0.45","@types/node-uuid":"0.0.28","tslint":"^4.5.1","typescript":"^2.2.1"},"dependencies":{"azure-storage":"^2.6.0","multer":"^1.3.0","node-uuid":"^1.4.8","path":"^0.12.7"},"gitHead":"4981cf0dc3a2ebe0a13963f958b2cfb7bfdc6d17","homepage":"https://github.com/Sliverb/multer-azure-blob-storage#readme","_id":"multer-azure-blob-storage@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"sliverb","email":"bayo@mit.edu"},"dist":{"integrity":"sha512-HXfQThsuWdc7Qj5CbJGeR22NDVpC4+6yTW2Hv/7Bsdccy6Ph9g6FHl38H7fM3ZPRMBiBoQDy+UXSLQ48YQIjDA==","shasum":"c2baa9d7cb9bd00d18e068a3a75c429ad6a84110","tarball":"https://registry.npmjs.org/multer-azure-blob-storage/-/multer-azure-blob-storage-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGJodZ6lKv0bIkSUa0X3PxEt/WmUPoODvAKFGo91Jo3gAiEA2IphNMtM5VIL2YTHVm/VqWXNEEMM7zGXx6+gMirfajM="}]},"maintainers":[{"name":"sliverb","email":"bayo@mit.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/multer-azure-blob-storage-1.0.0.tgz_1511224067497_0.6995229236781597"},"directories":{}},"1.0.1":{"name":"multer-azure-blob-storage","version":"1.0.1","description":"ES5/6 & Typescript friendly multer storage engine for Azure's blob storage.","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"lint":"tslint --project tsconfig.json","prebuild":"npm run lint","build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Sliverb/multer-azure-blob-storage.git"},"bugs":{"url":"https://github.com/Sliverb/multer-azure-blob-storage/issues"},"keywords":["multer","azure","express","file upload","azure storage","blob","typescript","ES5","ES6"],"author":{"name":"Bayo O"},"license":"MIT","private":false,"devDependencies":{"@types/multer":"^1.3.6","@types/node":"^6.0.45","@types/node-uuid":"0.0.28","tslint":"^4.5.1","typescript":"^2.2.1"},"dependencies":{"azure-storage":"^2.6.0","multer":"^1.3.0","node-uuid":"^1.4.8","path":"^0.12.7"},"gitHead":"52f68cd0c2bdf0abc6fca53453b2484481feedc5","homepage":"https://github.com/Sliverb/multer-azure-blob-storage#readme","_id":"multer-azure-blob-storage@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.6.1","_npmUser":{"name":"sliverb","email":"bayo@mit.edu"},"dist":{"integrity":"sha512-O3eTX9HidG8hCGA8AuBMyvBexKyfhQT+PDxHVmz4uZtOlzInVM2nN74Dd6LdhTx8A8m+JmCOKPgjWiyfUNfrew==","shasum":"2b20607b14d8db7054cb6010f2ddf4a4d5d8c618","tarball":"https://registry.npmjs.org/multer-azure-blob-storage/-/multer-azure-blob-storage-1.0.1.tgz","fileCount":9,"unpackedSize":33338,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF5rVMoNBZrhg2PyCvphEdobiEucozbR6och2DSsvtGPAiA4keJEQE129pQhjVLguNpf0xoT7XvOz6JirW18Frxp+Q=="}]},"maintainers":[{"name":"sliverb","email":"bayo@mit.edu"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/multer-azure-blob-storage_1.0.1_1522362353749_0.07768378207644999"},"_hasShrinkwrap":false},"1.0.2":{"name":"multer-azure-blob-storage","version":"1.0.2","description":"ES5/6 & Typescript friendly multer storage engine for Azure's blob storage.","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"lint":"tslint --project tsconfig.json","prebuild":"npm run lint","build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Sliverb/multer-azure-blob-storage.git"},"bugs":{"url":"https://github.com/Sliverb/multer-azure-blob-storage/issues"},"keywords":["multer","azure","express","file upload","azure storage","blob","typescript","ES5","ES6"],"author":{"name":"Bayo O"},"license":"MIT","private":false,"devDependencies":{"@types/node":"^6.0.45","@types/uuid":"^3.4.3","tslint":"^4.5.1","typescript":"^2.2.1"},"dependencies":{"@types/multer":"^1.3.6","azure-storage":"^2.6.0","express":"^4.16.3","multer":"^1.3.0","path":"^0.12.7","uuid":"^3.2.1"},"gitHead":"f71aead10312663a9e9350e7b8f1821b33cf78de","homepage":"https://github.com/Sliverb/multer-azure-blob-storage#readme","_id":"multer-azure-blob-storage@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"sliverb","email":"bayo@mit.edu"},"dist":{"integrity":"sha512-tyOeE/mwy2pJvR1+w8ZQE5NnsvN1ezps4mHvMgHa3cD5nTw97BKEJpA7xqMzq6rB9g4xJN1rZ0ykAIXiMTP5Xw==","shasum":"e7eded18a775f841c52a91d0038021037ab8734f","tarball":"https://registry.npmjs.org/multer-azure-blob-storage/-/multer-azure-blob-storage-1.0.2.tgz","fileCount":9,"unpackedSize":33350,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa7JXzCRA9TVsSAnZWagAAPX4QAI6OD0ZozL8kjfASa7Co\nwtmpWfLgbNzeuJiPWAPxgoc3s3w6xUBokG7QEGTCppJ51y77TBx1wbvu9Lx1\nspccIWDwrWcVcdbzDtGYBviQ/kIV1D+yCaB6XTHqUhLL1xd7taqGlh8W3zhr\nHOx3Nv1Rig31R9WJC0JUKj1jFp+UwjGyxx6HCd0wJ2vpPp/vRkVgc9YcOt1z\nTA6rvbqebCxo74MX51q7WiN/h57gCI5QLjKpfJrdBT1rb7W67XIhz/AMtMNS\nY5asZ/Saud4I3dqyyPK3aKXRx85HzAsajO03qniYSCAYBsv0r2SBc6WTGaL1\nYnvzFc90xlb8WRSywnEz7nvtd3C2VFq+Lj1Y0DFuTEqE0hJrlfE8ZlWZ+1ak\nG4H6H+/IgjVav23ifnh+oyxvvSsJehATsVQREfHxSr+jMTcWSNgT0LwBmSEM\nqhxFm1J/msW9GxefLprjOfo7an1ZBADsoXvhmHAAZOktxDKEzK1qD6N6cyNo\n2WZxj8y0Y8LVukHfOtG91xg9b+Ki1VCxddJfBZ0Hl81CHuuBiwrDwBuKtYwn\nDsfs2utcRxU0VlsaV5iPOhIkew+bgi5DNpS7jwWKVTUEQzMHeSx4CWSGxRXj\na1vycX279lInGLDPdz6aZ7UC/Y57Ely5C2uHabBoF67y3Ilz6WsAtl5tGmfF\n0n1B\r\n=kmbY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFGiw9UPoj248jkUkeecKV3FbqQXvUQa+QxPEL3hwZapAiEAh5EebvepwoJDALes+9jIfgABHrkdXEcQ86qLldw+xbM="}]},"maintainers":[{"name":"sliverb","email":"bayo@mit.edu"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/multer-azure-blob-storage_1.0.2_1525454322455_0.13133796523191776"},"_hasShrinkwrap":false},"1.1.0":{"name":"multer-azure-blob-storage","version":"1.1.0","description":"ES5/6 & Typescript friendly multer storage engine for Azure's blob storage.","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"lint":"tslint --project tsconfig.json","prebuild":"npm run lint","build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Sliverb/multer-azure-blob-storage.git"},"bugs":{"url":"https://github.com/Sliverb/multer-azure-blob-storage/issues"},"keywords":["multer","azure","express","file upload","azure storage","blob","typescript","ES5","ES6"],"author":{"name":"Bayo O"},"license":"MIT","private":false,"devDependencies":{"@types/node":"14.17.27","@types/uuid":"8.3.1","tslint":"6.1.3","typescript":"4.4.4"},"dependencies":{"@types/multer":"1.4.7","azure-storage":"2.10.5","express":"4.17.1","multer":"1.4.3","path":"0.12.7","uuid":"8.3.2"},"gitHead":"ea8d385fcb99239e49b6f6ea02a8377e1eef4ca0","homepage":"https://github.com/Sliverb/multer-azure-blob-storage#readme","_id":"multer-azure-blob-storage@1.1.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.13","dist":{"integrity":"sha512-pefjv/9/ZxRN7SSoncnXyTbPp556ng9aUeyJ1WvFEORT5v0w07zE0hlPahxDWYD+Cn4nO6hjVrWssFIK8TjWRg==","shasum":"267689be4d86abb14e360aa4631717b2b549e8fd","tarball":"https://registry.npmjs.org/multer-azure-blob-storage/-/multer-azure-blob-storage-1.1.0.tgz","fileCount":9,"unpackedSize":36839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2z1KCRA9TVsSAnZWagAAVtYP/3DJzWoA8y1FyHs2e+1z\nRHc551ihHiU8v3g8kC21+fdbd/CLludoyfNNATYPXImN4FoxeoILcDIX6JUc\n6I0iUz2XllEb8B7FwS1ooglPd6TNwiwDP8Ydhmgjg2et9185lKt2TooMceF0\nvNRsiEOUUHnXun+cWiP3i4CrfILKUR5w4vV8JHgNjFB6bGMhREvEGUZV8hon\nr7n31s6iWi21PvOJPM2Q+YjfaengNad3npbEYbGxWeknzzjT8lH0rSwTX8+q\nU8AbSJ+hRAShEyTgnvFyltObrhbj6efVhigY0EC2dlv3gLCjCe1oZfSFEZrW\n9a58RtY5VMXREyH1X4s6tLScOy20zOkkrrIQoRYWCgkY4TLwv84cUoUf4mr3\nwNndwQ6IQHX1+7wiTXIKzWGJUZTQ1geNYI4e9xGSTjXqQsO0hOxnNm8tvZpA\niucZEB1jK+m1YXp4fW/qSM3ww36R4lIw+U6yn+wp36B4wVbumQ5ec8y3Atet\nVqi+SQuEGXTVFm7NWbbeddIOi8oLBI6EiY/lBWcFLgro2vfv2dva2yca7FkI\nHenSmOFperv1X6EGwVi5GukGtQv4GxRx8tHHriGKQkfwNmA+rcnMZtCioFAI\nGgxaRSMumIJHB4Lo3U6oSCHnNmYdpGkb90cN6XlnD55Piy9h4F7ewfty4u7G\nbWg7\r\n=Upau\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCd0BUZLPuoMT/Jfd8Nls5694GReDlyz5Tw/oYXGxTMaQIhAI6tQ0BJRi/ucCXY0B3KdQL6avO+/lRUnvqCEDC3Ctjt"}]},"_npmUser":{"name":"sliverb","email":"bayo@mit.edu"},"directories":{},"maintainers":[{"name":"sliverb","email":"bayo@mit.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/multer-azure-blob-storage_1.1.0_1634502478252_0.1531325562154653"},"_hasShrinkwrap":false},"1.2.0":{"name":"multer-azure-blob-storage","version":"1.2.0","description":"ES5/6 & Typescript friendly multer storage engine for Azure's blob storage.","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"lint":"tslint --project tsconfig.json","prebuild":"npm run lint","build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Sliverb/multer-azure-blob-storage.git"},"bugs":{"url":"https://github.com/Sliverb/multer-azure-blob-storage/issues"},"keywords":["multer","azure","express","file upload","azure storage","blob","typescript","ES5","ES6"],"author":{"name":"Bayo O"},"license":"MIT","private":false,"devDependencies":{"@types/multer":"^1.4.7","@types/node":"^18.6.2","@types/uuid":"^8.3.4","tslint":"^6.1.3","typescript":"^4.7.4"},"dependencies":{"azure-storage":"^2.10.7","express":"^4.18.1","multer":"^1.4.5-lts.1","path":"^0.12.7","uuid":"^8.3.2"},"gitHead":"ca71719a7abc2d4e9a0552e518e84793422743f3","homepage":"https://github.com/Sliverb/multer-azure-blob-storage#readme","_id":"multer-azure-blob-storage@1.2.0","_nodeVersion":"18.7.0","_npmVersion":"8.16.0","dist":{"integrity":"sha512-jFxXMRqpeHPx4COOcgmLr4bd2qIGIRieanoEc9IcNZs5QPiZ+M4rD+21oUE8h3qdF5UyJwRbskZkYsmY3W+KMg==","shasum":"4c4d2e9ed8c775b314ea1e72383e1b9d0c557e9e","tarball":"https://registry.npmjs.org/multer-azure-blob-storage/-/multer-azure-blob-storage-1.2.0.tgz","fileCount":9,"unpackedSize":36330,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClgCNksOL1vjHJQvUpuL3zN7kC0r/Tn09P5WdBSIQB5wIhAJyGAPdYQ14x/cIm0T5vdF0dML7C4tS2qrndQqNOfi3V"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6sNUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJ/A/6AwI7et2Tl/IYrjp9WU5ypsgMXDtx4adSQV+0MoybMeLiiq1Z\r\nEgZa08xH22ifsboW5ayHx9QcF+okej9jE0acxfy3k3gdVsF1y7Z032/SMtpI\r\n/VVzVMpAdJfb64cxG+Xb1LB7EXA2xnZI1/5W3gurBytk/PL0s5/XnQvxxQh4\r\nXGbql1xSk7CZyrFtyv18f7RnCGfzYw1BuuLbaqbVh5XRlskWFVEWtka28kSw\r\nHYyom5HYSS3+3vonbeq0IR2SYIIdaiQrL1Su00HraR+H+6JIgzFtJxjZsQYW\r\nyq4MCJmWCgGPmJzx93wiR07LQ53gZwcS6DcATMs/EHxFx4X3boNVyWWAuVc+\r\nINS+jV+6cpQIQS5+uXEiBjvaOc8EGThH+C5M0cxmE1vT67co9//werujNp5w\r\nYwlP1eTwlX4Ke4dUoI4dGplL7aEx3P7fjIZE1sEiwQHBahS/mgfRZLcRlb1N\r\nCxRyAehR9ebo8akDq90giJXcN5G/evfUPTVjlW3wTGsSbB/wXoRFR0cSmZrM\r\n3r3upuO0nivuH9q7dquq3+vCwvMHDpAV3ILFPvM4uIu4FxxsFVZpd6C0/Y94\r\nfU2tYpMKXQBLVs8bBdxPzASANKBwGZ+e4xMtatz+jTCnbqB8aBlQMegMzW10\r\nealPKuxhuSWYA1/3lLYm4V4jWi2cLIje4Hk=\r\n=Kl/W\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"sliverb","email":"bayo@mit.edu"},"directories":{},"maintainers":[{"name":"sliverb","email":"bayo@mit.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/multer-azure-blob-storage_1.2.0_1659552596123_0.40355572315087396"},"_hasShrinkwrap":false}},"readme":"## Multer Azure Blob Storage\n[![npm version](https://badge.fury.io/js/multer-azure-blob-storage.svg)](https://badge.fury.io/js/multer-azure-blob-storage) [![Build Status](https://app.travis-ci.com/symphonicc/multer-azure-blob-storage.svg?branch=master)](https://app.travis-ci.com/github/symphonicc/multer-azure-blob-storage)\n\nES6 &amp; Typescript friendly [Multer](https://github.com/expressjs/multer) storage engine for Azure's blob storage.\n\n### Installation\n\n```\nnpm i -S multer-azure-blob-storage\n```\nor\n```\nyarn add multer-azure-blob-storage\n```\n\n### Usage\n\n#### Typescript\n\nLeverages strong typings\n``` javascript\nimport * as multer from 'multer';\nimport { MulterAzureStorage, MASNameResolver } from 'multer-azure-blob-storage';\n\nconst resolveBlobName: MASNameResolver = (req: any, file: Express.Multer.File): Promise<string> => {\n    return new Promise<string>((resolve, reject) => {\n        const blobName: string = yourCustomLogic(req, file);\n        resolve(blobName);\n    });\n};\n\nexport type MetadataObj = { [k: string]: string };\nconst resolveMetadata: MASObjectResolver = (req: any, file: Express.Multer.File): Promise<MetadataObj> => {\n    return new Promise<MetadataObj>((resolve, reject) => {\n        const metadata: MetadataObj = yourCustomLogic(req, file);\n        resolve(metadata);\n    });\n};\n\nconst resolveContentSettings: MASObjectResolver = (req: any, file: Express.Multer.File): Promise<MetadataObj> => {\n    return new Promise<MetadataObj>((resolve, reject) => {\n        const contentSettings: MetadataObj = yourCustomLogic(req, file);\n        resolve(contentSettings);\n    });\n};\n\nconst azureStorage: MulterAzureStorage = new MulterAzureStorage({\n    connectionString: 'DefaultEndpointsProtocol=https;AccountName=mystorageaccountname;AccountKey=wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY;EndpointSuffix=core.windows.net',\n    accessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY',\n    accountName: 'mystorageaccountname',\n    containerName: 'documents',\n    blobName: resolveBlobName,\n    metadata: resolveMetadata,\n    contentSettings: resolveContentSettings,\n    containerAccessLevel: 'blob',\n    urlExpirationTime: 60\n});\n\nconst upload: multer.Instance = multer({\n    storage: azureStorage\n});\n\napp.post('/documents', upload.any(), (req: Request, res: Response, next: NextFunction) => {\n  console.log(req.files)\n  res.status(200).json(req.files)\n});\n```\n\n#### Javascript ES6\n\nCommon.js style imports\n```javascript\nconst multer = require('multer')\nconst MulterAzureStorage = require('multer-azure-blob-storage').MulterAzureStorage;\n```\n\nE6 style imports\n``` javascript\nimport * as multer from 'multer';\nimport { MulterAzureStorage } from 'multer-azure-blob-storage';\n```\n\nRest of the JS code\n```javascript\nconst resolveBlobName = (req, file) => {\n    return new Promise((resolve, reject) => {\n        const blobName = yourCustomLogic(req, file);\n        resolve(blobName);\n    });\n};\n\nconst resolveMetadata = (req, file) => {\n    return new Promise((resolve, reject) => {\n        const metadata = yourCustomLogic(req, file);\n        resolve(metadata);\n    });\n};\n\nconst resolveContentSettings = (req, file) => {\n    return new Promise((resolve, reject)) => {\n        const contentSettings = yourCustomLogic(req, file);\n        resolve(contentSettings);\n    };\n};\n\nconst azureStorage = new MulterAzureStorage({\n    connectionString: 'DefaultEndpointsProtocol=https;AccountName=mystorageaccountname;AccountKey=wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY;EndpointSuffix=core.windows.net',\n    accessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY',\n    accountName: 'mystorageaccountname',\n    containerName: 'documents',\n    blobName: resolveBlobName,\n    metadata: resolveMetadata,\n    contentSettings: resolveContentSettings,\n    containerAccessLevel: 'blob',\n    urlExpirationTime: 60\n});\n\nconst upload = multer({\n    storage: azureStorage\n});\n\napp.post('/documents', upload.any(), (req, res, next) => {\n  console.log(req.files)\n  res.status(200).json(req.files)\n});\n```\n\nMore details on using `upload` can be found in the [Multer documentation](https://github.com/expressjs/multer)\n\n### File information\n\nMulter Azure Blob Storage will return the following information in each file uploaded. This can be found in the `req.files` param:\n\nKey | Description | Note\n---|---|---\n`fieldname` | The field name/key sent in the form's post request. | Added by Multer\n`originalname` | Full original name of the file on the user's computer. | Added by Multer\n`encoding` | File encoding type. | Added by Multer\n`mimetype` | MIME type of the file. | Added by Multer\n`blobName` | Blob/file name of created blob in Azure storage. | \n`container` | Name of azure storage container where the blob/file was uploaded to. | \n`blobType` | Type of blob. | From the result of call to azure's `getBlobProperties()` of `blobService`\n`size` | Size of the blob. | From the result of call to azure's `getBlobProperties()` of `blobService`\n`etag` | Etag. | From the result of call to azure's `getBlobProperties()` of `blobService`\n`metadata` | Blob's metadata. | From the result of call to azure's `getBlobProperties()` of `blobService`\n`url` | The full url to access the uploaded blob/file. | \n\n### Configuration object\nDetails of the configuration object that needs to be passed into the constructor of the MulterAzureStorage class.\n\n| Parameter Name | Type | Sample Value |\n|---|---|---|\n| `connectionString` | `string` | `'DefaultEndpointsProtocol=https;AccountName=mystorageaccountname;AccountKey=wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY;EndpointSuffix=core.windows.net'` |\n| `accessKey` | `string` | `'wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY'` |\n| `accountName` | `string` | `'mystorageaccountname'` |\n| `containerName` | `string` or `function: MASNameResolver` | `'documents'` or `(req: any, file: Express.Multer.File) => Promise<string>` |\n| `metadata` | `{ [k: string]: string }` or `function: MASObjectResolver` | `'{author: John Doe; album: ASOT}'` or `(req: any, file: Express.Multer.File) => Promise<{[k: string]: string}>` |\n| `blobName` | `function: MASNameResolver` (optional) | `(req: any, file: Express.Multer.File) => Promise<string>` |\n| `containerAccessLevel` | `string` (optional) | `'blob'` or `'container'` or `'private'` |\n| `urlExpirationTime` | `number` (optional) | `60` |\n\nFor more information about the meaning of individual parameters please check [Azure documentation](https://azure.microsoft.com/en-us/documentation/articles/storage-nodejs-how-to-use-blob-storage/) on node.js integration.\n\n### Defaults\n\nFor the optional parameters in the configuration object for the MulterAzureStorage class, here are the default fallbacks:\n- `containerAccessLevel`: blob\n- `urlExpirationTime`: 60 minutes. NOTE: To unset this property and not revert to the default, pass in `-1`\n- `blobName`: Date.now() + '-' + uuid.v4() + path.extname(file.originalname). This results in a url safe filename that looks like `'1511161727560-d83d24c8-d213-444c-ba72-316c7a858805.png'`\n\n### File naming\n\nThe `containerName` can be anything you choose, as long as it's unique to the storage account and as long as it fits Azure's naming restrictions. If the container does not exist the storage engine will create it.\n\nThe `blobName` in an Azure container also needs to have a unique name.\n\n`multer-azure-blob-storage` allows you to customize the `containerName` and `blobName` per request before uploading the file. This can be done by proving a `MASNameResolver` function in the configuation object for the desired parameter.\n``` javascript\nconst resolveName: MASNameResolver = (req: any, file: Express.Multer.File): Promise<string> => {\n    return new Promise<string>((resolve, reject) => {\n        // Compute containerName or blobName with your custom logic.\n        const computedName: string = yourCustomLogic(req, file);\n        resolve(computedName);\n    });\n};\n```\n\n`multer-azure-blob-storage` also allows you to add/customize `metadata` and `contentSettings` per request before uploading the file. This can be done by proving a `MASObjectResolver` function in the configuation object for the desired parameter.\n``` javascript\nexport type MetadataObj = { [k: string]: string };\nconst resolveMetadata: MASObjectResolver = (req: any, file: Express.Multer.File): Promise<MetadataObj> => {\n    return new Promise<MetadataObj>((resolve, reject) => {\n        const metadata: MetadataObj = yourCustomLogic(req, file);\n        resolve(metadata);\n    });\n};\n```\n\n### Azure\n\n#### Creating a storage account\n\nFor instructions on how to create a storage account, see the following [Azure documentation](https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account#create-a-storage-account).\n\n#### Credentials (Quick tips)\n\nYour credentials can all be obtained under the Access keys section in the storage account pane in Azure.\n\nThe `connectionString` is prefered. If its not provides, please provide `accessKey` and `accountName`.\n\nYou only need to provide one of the two access keys in the `accessKey` field.\n\nThe `accountName` is just the name of your storage account that you've created in Azure.\n\nIf using the MulterAzureStorage class without passing in any configuration options then the following environment variables will need to be set:\n1. AZURE_STORAGE_CONNECTION_STRING, for the `connectionString`.\n2. AZURE_STORAGE_ACCESS_KEY, for the `accessKey`.\n3. AZURE_STORAGE_ACCOUNT, for the `accountName`.\n\n### Tests\nNot implemented yet\n\n### Thanks\nAll great things are built on the shoulder of giants. I want to thank my giants for lending their shoulders:\n- [mckalexee](https://github.com/mckalexee/multer-azure)\n- [MantaCodeDevs](https://github.com/MantaCodeDevs/multer-azure-storage)\n\n\n### License\n\n[MIT](LICENSE)\n","maintainers":[{"name":"sliverb","email":"bayo@mit.edu"}],"time":{"modified":"2022-08-03T18:49:56.407Z","created":"2017-11-21T00:27:47.570Z","1.0.0":"2017-11-21T00:27:47.570Z","1.0.1":"2018-03-29T22:25:53.884Z","1.0.2":"2018-05-04T17:18:42.556Z","1.1.0":"2021-10-17T20:27:58.397Z","1.2.0":"2022-08-03T18:49:56.306Z"},"homepage":"https://github.com/Sliverb/multer-azure-blob-storage#readme","keywords":["multer","azure","express","file upload","azure storage","blob","typescript","ES5","ES6"],"repository":{"type":"git","url":"git+https://github.com/Sliverb/multer-azure-blob-storage.git"},"author":{"name":"Bayo O"},"bugs":{"url":"https://github.com/Sliverb/multer-azure-blob-storage/issues"},"license":"MIT","readmeFilename":"README.md"}