Registry / storage / multer-az-storage-blob

multer-az-storage-blob

JSON →
library1.1.0jsnpmunverified

Multer storage engine for Azure Blob Storage using @azure/storage-blob. Version 1.1.0. Supports ES5/ES6 and TypeScript with strong typings. Adapted from multer-azure-blob-storage with updated dependencies and Azure AD authentication. Backwards-compatible attempt. Release cadence not specified.

npm install multer-az-storage-blob
INSTALL
IMPORT
SIG · MULTER-AZ-STORAGE-
M
multer-az-storage-blob
storagejavascriptv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MulterAzureStorage
import { MulterAzureStorage } from 'multer-az-storage-blob'
const MulterAzureStorage = require('multer-az-storage-blob')
Default import not provided; must use named import or destructure from require.
MASNameResolver
import { MASNameResolver } from 'multer-az-storage-blob'
TypeScript type exported for name resolver callback.
MASObjectResolver
import { MASObjectResolver } from 'multer-az-storage-blob'
TypeScript type exported for metadata/contentSettings callbacks.

Shows basic setup with MulterAzureStorage using Azure AD authentication, single file upload endpoint.

const multer = require('multer'); const { MulterAzureStorage } = require('multer-az-storage-blob'); const express = require('express'); const app = express(); const azureStorage = new MulterAzureStorage({ authenticationType: 'azure ad', accountName: 'mystorageaccountname', containerName: 'documents', blobName: (req, file) => Promise.resolve(file.originalname), containerAccessLevel: 'blob' }); const upload = multer({ storage: azureStorage }); app.post('/upload', upload.single('file'), (req, res) => { res.json(req.file); }); app.listen(3000);
Debug
Known issues
deprecatedauthenticationType 'storage account key' is deprecated in favor of 'azure ad'
fix
Use authenticationType: 'azure ad' and provide accountName.
affects: >=1.0.0
gotchacontainerAccessLevel must be 'blob', 'container', or undefined; invalid values default to private
fix
Set containerAccessLevel to one of 'blob', 'container', or omit.
affects: >=1.0.0
gotchablobName must be a function returning a Promise<string>; string values cause runtime error
fix
Always provide a resolver function (e.g., (req, file) => Promise.resolve(file.originalname)).
affects: >=1.0.0
gotchametadata and contentSettings resolvers must return objects, not strings
fix
Ensure resolver functions return an object like { key: 'value' }.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: multer_az_storage_blob_1.MulterAzureStorage is not a constructor
Incorrect import (default import instead of named import)
fix
Use import { MulterAzureStorage } from 'multer-az-storage-blob' or const { MulterAzureStorage } = require('multer-az-storage-blob')
Error: Container 'undefined' not found
containerName not provided or undefined
fix
Provide a valid containerName in the options.
AuthenticationError: No valid authentication method
authenticationType not set or invalid
fix
Set authenticationType to 'azure ad' and provide accountName.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
multerrequiredMulter storage engine requires multer as peer dependency
@azure/storage-blobrequiredAzure Blob Storage client used internally
Agent activity
16 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
multer-az-storage-blob — npm install multer-az-storage-blob · libregistry