Registry / storage / multer-azure-storage

multer-azure-storage

JSON →
library0.2.0jsnpmunverified

Multer Azure Storage is a storage engine for multer (Express middleware) that saves uploaded files to Azure Blob Storage. Version 0.2.0 is the latest stable release. It supports configuration via connection string or account name/access key, customizable file naming, and returns blob properties (size, etag, metadata, URL) for each upload. This package is specific to the older Azure Storage SDK (v1) and the deprecated azure-storage npm package; it is not compatible with @azure/storage-blob v12. The repository appears unmaintained with no tests and no updates since 2017.

npm install multer-azure-storage
INSTALL
IMPORT
SIG · MULTER-AZURE-STORA
M
multer-azure-storage
storagejavascriptv0.2.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
const MulterAzureStorage = require('multer-azure-storage');
import MulterAzureStorage from 'multer-azure-storage';
This package uses CommonJS and cannot be imported with ESM import syntax. It provides a single default export.
multer
const multer = require('multer');
const multer = require('multer')().
Multer is a required peer dependency and is not included automatically.
azure-storage blobService
const azure = require('azure-storage'); const blobService = azure.createBlobService(...);
const { BlobServiceClient } = require('@azure/storage-blob');
This package uses the old azure-storage package (deprecated), not the modern @azure/storage-blob.

Shows how to set up an Express server using multer and multer-azure-storage to handle file uploads to Azure Blob Storage.

const express = require('express'); const multer = require('multer'); const MulterAzureStorage = require('multer-azure-storage'); const app = express(); const upload = multer({ storage: new MulterAzureStorage({ azureStorageConnectionString: process.env.AZURE_STORAGE_CONNECTION_STRING ?? '', containerName: 'uploads', containerSecurity: 'blob', fileName: function (file) { return file.originalname; } }) }); app.post('/upload', upload.single('file'), (req, res) => { res.json({ message: 'File uploaded successfully', file: req.file }); }); app.listen(3000, () => console.log('Server started on port 3000'));
Debug
Known issues
deprecatedDependency 'azure-storage' is deprecated. Use @azure/storage-blob instead.
fix
Migrate to the @azure/storage-blob package and use a different multer storage engine that supports it.
affects: >=0.0.0
breakingPackage uses CommonJS; attempting ESM import will fail.
fix
Use require() instead of import.
affects: 0.0.0 - 0.2.0
gotchaThe 'azureStorageConnectionString' or 'azureStorageAccount'/'azureStorageAccessKey' combination is required. Missing either will cause runtime errors.
fix
Provide a valid connection string or account credentials.
affects: >=0.0.0
gotchaContainer must be created before uploading. multer-azure-storage does not create the container automatically.
fix
Manually create the Azure Storage container before using the engine.
affects: >=0.0.0
deprecatedThe 'containerSecurity' option defaults to 'blob' and accepts 'container' or 'blob'. This parameter is a legacy Azure Storage concept.
fix
Use 'blob' for public read access to blobs, or set to 'container' for full public access.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'azure-storage'
azure-storage is a required peer dependency that must be installed separately.
fix
Run 'npm install azure-storage' to install the dependency.
TypeError: MulterAzureStorage is not a constructor
CommonJS module imported incorrectly with ESM import syntax.
fix
Use 'const MulterAzureStorage = require('multer-azure-storage');' instead of 'import MulterAzureStorage from ...'
The storage account connection string is not specified
No connection string or account details provided in the options.
fix
Provide 'azureStorageConnectionString' or both 'azureStorageAccount' and 'azureStorageAccessKey'.
Container '...' does not exist
The specified Azure container does not exist.
fix
Create the container in Azure Portal or via Azure CLI before uploading files.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
azure-storagerequiredUsed to interact with Azure Blob Storage. This package is deprecated and not compatible with @azure/storage-blob.
Agent activity
15 hits · last 30 days
node
14
Resources
multer-azure-storage — npm install multer-azure-storage · libregistry