Registry / storage / fast-azure-storage

fast-azure-storage

JSON →
library4.0.0jsnpmunverified

A low-level, highly optimized Node.js client for Azure Storage services (blob, queue, table) with minimal dependencies. Version 4.0.0 requires Node >=20. Designed for maximum performance, it includes a custom HTTPS agent tuned for Azure Storage to reduce latency and connection errors. Key differentiators: no abstraction layers, direct access to storage types (e.g., Edm.Int64, Edm.Binary), support for shared-key and SAS authentication with automatic SAS refresh. Release cadence is low; library is mature but not actively extended.

npm install fast-azure-storage
INSTALL
IMPORT
SIG · FAST-AZURE-STORAGE
F
fast-azure-storage
storagejavascriptv4.0.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.

namespace
import * as azure from 'fast-azure-storage'
const azure = require('fast-azure-storage')
Library is ESM-only since v4; using require will throw ERR_REQUIRE_ESM
AzureAgent
import { Agent } from 'fast-azure-storage'
import { AzureAgent } from 'fast-azure-storage'
Exported as 'Agent' (custom HTTPS agent)
Table
import { Table } from 'fast-azure-storage'
import Table from 'fast-azure-storage'
Table is a named export, not default
Blob
import { Blob } from 'fast-azure-storage'
import { BlobClient } from 'fast-azure-storage'
Named 'Blob' not 'BlobClient'
Queue
import { Queue } from 'fast-azure-storage'
import { QueueClient } from 'fast-azure-storage'
Named 'Queue' not 'QueueClient'

Creates a queue, sends a message, retrieves it, deletes the message, and cleans up the queue.

import { Queue } from 'fast-azure-storage'; const queue = new Queue({ accountId: process.env.AZURE_STORAGE_ACCOUNT ?? '', accessKey: process.env.AZURE_STORAGE_ACCESS_KEY ?? '', }); async function main() { const queueName = 'test-queue' + Date.now(); await queue.createQueue(queueName); console.log(`Queue '${queueName}' created`); await queue.putMessage(queueName, 'Hello Azure!'); console.log('Message sent'); const [messages] = await queue.getMessages(queueName, { numofmessages: 1 }); console.log('Received:', messages[0].messageText); await queue.deleteMessage(queueName, messages[0].messageId, messages[0].popReceipt); await queue.deleteQueue(queueName); } main().catch(console.error);
Debug
Known issues
breakingVersion 4.0.0 drops CommonJS support; require() will fail with ERR_REQUIRE_ESM
fix
Switch to ESM imports (import {} from 'fast-azure-storage') or use dynamic import()
affects: >=4.0.0
breakingNode.js >=20 required in v4; older versions will fail with Node.js version mismatch
fix
Upgrade Node.js to version >=20
affects: >=4.0.0
deprecatedThe 'sas' option as a plain string is deprecated; use a function returning a promise instead
fix
Provide a function that returns a Promise<string> for SAS token
affects: <4.0.0
gotchaCustom agent must be an instance of azure.Agent; using Node's default https.Agent may cause connection errors
fix
Use new azure.Agent({...}) instead of new https.Agent({...})
affects: *
gotchaTable entity types must be explicitly annotated with @odata.type for Int64 and Binary; omission causes silent data corruption
fix
Add properties like 'count@odata.type': 'Edm.Int64' and 'buffer@odata.type': 'Edm.Binary'
affects: *
Errors
Common errors & fixes
ERR_REQUIRE_ESM
Using CommonJS require() on an ESM-only package (v4+)
fix
Change to import * as azure from 'fast-azure-storage' or use dynamic import()
The provided SAS token has expired
SAS token passed as plain string without refresh function
fix
Use a function that returns a fresh SAS token: sas: () => getSasToken()
TypeError: agent is not an instance of Agent
Passing a regular https.Agent instead of azure.Agent
fix
Use new azure.Agent({...}) for the agent option
The value for one of the XML nodes is too long or too short
Queue message text exceeds 64KB limit
fix
Ensure messageText is <=64KB (base64-encoded if binary)
Upgrade
Version history
4.0.0latest on npm
Audit
Dependencies
noderequiredRequires Node.js >=20 for runtime features (ESM, nullish coalescing, etc.)
Agent activity
35 hits · last 30 days
node
34
Resources
fast-azure-storage — npm install fast-azure-storage · libregistry