0.4.0 • Published 5 months ago

@rocketmakers/storage-azure v0.4.0

Weekly downloads
53
License
MIT
Repository
github
Last release
5 months ago

@rocketmakers/storage-azure

This package facilitates interaction with Azure Storage. The package includes an AzureStorage class that implements the IStorage interface, providing a seamless way to perform various operations on files stored in Azure Storage. The class supports functionalities such as copying, deleting, reading, creating files, and handling chunked uploads, making it a powerful tool for managing your storage needs.

Installation

To use this package, install it via npm:

npm install @rocketmakers/storage-azure
yarn add @rocketmakers/storage-azure
pnpm add @rocketmakers/storage-azure

Usage

Below is an example of how to use the AzureStorage class in your Node.js application:

import { AzureStorage, IAzureConfig, IAzureStorageConfig } from '@rocketmakers/storage-azure';

// Configuration for Azure Storage
const azureConfig: IAzureConfig = {
  connectionString: 'your-azure-connection-string',
};

// Storage configuration
const storageConfig: IAzureStorageConfig = {
  azure: azureConfig,
  containerName: 'your-container-name',
};

// Create an instance of AzureStorage
const azureStorage = new AzureStorage(storageConfig);

// Example: Validate storage
const validationResult = await azureStorage.validate();
console.log('Storage validation result:', validationResult);

// Example: Copy a file
const fromFilePath = 'source-file.txt';
const toFilePath = 'destination-file.txt';
const copyResult = await azureStorage.fileCopy(fromFilePath, toFilePath);
console.log('File copy result:', copyResult);

// ... Other operations (delete, read, create, etc.)
0.4.0

5 months ago

0.3.1

11 months ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

5 years ago

0.1.6

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago