@tus/azure-store

v0.1.0
Azure blob storage for @tus/server

@tus/azure-store

Azure Store based on the Append Blob Client Azure Blob AppendBlobClient.

Contents

Install

In Node.js (16.0+), install with npm:

npm install @tus/azure-store

Use

const {Server} = require('@tus/server')
const {AzureStore} = require('@tus/azure-store')

const server = new Server({
  path: '/files',
  datastore: new AzureStore({
      account: process.env.AZURE_ACCOUNT_ID,
      accountKey: process.env.AZURE_ACCOUNT_KEY,
      containerName: process.env.AZURE_CONTAINER_NAME,
  }),
})
// ...

API

This package exports AzureStore. There is no default export.

new AzureStore(options)

Creates a new azure store with options.

options.account

Azure account ID (string).

options.accountKey

Azure account key (string).

options.containerName

Azure storage container name (string).

options.cache

Provide your own cache solution for the metadata of uploads (KvStore) to reduce the calls to storage server. Default is (MemoryKvStore) which stores the data in memory.

Extensions

The tus protocol supports optional extensions. Below is a table of the supported extensions in @tus/azure-store. More will be added in the future releases.

Extension @tus/file-store
Creation
Creation With Upload
Expiration
Checksum
Termination
Concatenation

Types

This package is fully typed with TypeScript.

Compatibility

This package requires Node.js 16.0+.

Contribute

See contributing.md.

License

MIT © tus

npm i @tus/azure-store

Metadata

  • MIT
  • >=16
  • Unknown
  • released 9/5/2024

Downloads