Skip to content

Minima.js API


Minima.js API / @minimajs/azure-blob / createAzureBlobDriver

Function: createAzureBlobDriver()

Call Signature

ts
function createAzureBlobDriver(options): DiskDriver;

Create an Azure Blob Storage driver for @minimajs/disk

Use web-native File APIs to interact with Azure Blob Storage—no need to learn the Azure SDK.

Parameters

options

AzureBlobDriverOptions

Returns

DiskDriver

Example

typescript
import { createAzureBlobDriver } from '@minimajs/azure-blob';
import { createDisk } from '@minimajs/disk';

const azureDriver = createAzureBlobDriver({
  connectionString: process.env.AZURE_STORAGE_CONNECTION_STRING!,
  container: 'my-container',
  publicUrl: 'https://cdn.example.com', // optional CDN URL
});

const disk = createDisk({ driver: azureDriver });

// Use web-native APIs - no Azure SDK needed!
await disk.put('documents/file.txt', 'Hello World');
const file = await disk.get('documents/file.txt');
const text = await file.text(); // Standard File API

Call Signature

ts
function createAzureBlobDriver(client, options): DiskDriver;

Create an Azure Blob Storage driver for @minimajs/disk

Use web-native File APIs to interact with Azure Blob Storage—no need to learn the Azure SDK.

Parameters

client

BlobServiceClient

options

AzureBlobBaseDriverOptions

Returns

DiskDriver

Example

typescript
import { createAzureBlobDriver } from '@minimajs/azure-blob';
import { createDisk } from '@minimajs/disk';

const azureDriver = createAzureBlobDriver({
  connectionString: process.env.AZURE_STORAGE_CONNECTION_STRING!,
  container: 'my-container',
  publicUrl: 'https://cdn.example.com', // optional CDN URL
});

const disk = createDisk({ driver: azureDriver });

// Use web-native APIs - no Azure SDK needed!
await disk.put('documents/file.txt', 'Hello World');
const file = await disk.get('documents/file.txt');
const text = await file.text(); // Standard File API