npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vestfoldfylke/azure-blob-client

v1.0.0

Published

A client for working with Azure storage blobs

Readme

azure-blob-client

A convenient library for working with Azure storage blobs

Get started

  1. Install
    npm i @vestfoldfylke/azure-blob-client
  2. Setup environment variables (Not required)

| Name | Example | |------------------------------|--------------------------------------------------------------------------------------------------------------------| | AZURE_BLOB_CONNECTION_STRING | DefaultEndpointsProtocol=https;AccountName=[AccountName];AccountKey=[AccountKey];EndpointSuffix=core.windows.net | | AZURE_BLOB_CONTAINER_NAME | Blobs |

Usage

import { BlobStorageClient } from "@vestfoldfylke/azure-blob-client";

// Create a new BlobStorageClient instance where connection string and container name are provided via environment variables explicitly
const blobStorageClient = new BlobStorageClient({
  connectionString: "<your-connection-string>",
  containerName: "<your-container-name>"
});

// Create a new BlobStorageClient instance where connection string and container name are provided via environment variables implicitly
// NOTE: Make sure the AZURE_BLOB_CONNECTION_STRING and AZURE_BLOB_CONTAINER_NAME environment variables are set
const blobStorageClient = new BlobStorageClient();

Functions & examples

Save

Saves content to a given path

// Create a blob with path test.txt
await blobStorageClient.save('test.txt', 'testdata');
await blobStorageClient.save('test/test2.txt', 'data:plain/text;utf-8,test2');
await blobStorageClient.save('test/folder1/test3.txt', 'data:plain/text;utf-8,test3');

We recommend using the dataUrl-format for storing data as it makes it easier to work with after it is retrieved. Example: img-tags in HTML can display them as pictures and browsers can easily handle and download them.

If stored in dataUrl format the MIME type and encoding will be parsed when retrieving the data.

List

List one or more blobs matching the provided path. The parameter path works as startsWith, so if you e.g. want to list blobs inside a folder add a / at the end of the path

await blobStorageClient.list(`${directoryName}/`)

// Gets all blobs that has a path that starts with test
await blobStorageClient.list('test');

// Gets all blobs in container
await blobStorageClient.list('*');

// Yields
[
   {
      "name": "test.txt",
      "deleted": undefined,
      "snapshot": undefined,
      "versionId": undefined,
      "isCurrentVersion": undefined,
      "properties": {
         "createdOn": "2026-01-27T17:30:22.000Z",
         "lastModified": "2026-01-27T17:30:22.000Z",
         "etag": "0x1B91582CD8B72C0",
         "contentLength": 54,
         "contentType": "application/octet-stream",
         "contentEncoding": undefined,
         "contentLanguage": undefined,
         "contentMD5": "<Buffer 3b 43 94 49 9c 1c 6a c5 2d 27 da 62 da 11 03 0d>",
         "contentDisposition": undefined,
         "cacheControl": undefined,
         "blobSequenceNumber": undefined,
         "blobType": "BlockBlob",
         "leaseStatus": "unlocked",
         "leaseState": "available",
         "leaseDuration": undefined,
         "copyId": undefined,
         "copyStatus": undefined,
         "copySource": undefined,
         "copyProgress": undefined,
         "copyCompletedOn": undefined,
         "copyStatusDescription": undefined,
         "serverEncrypted": true,
         "incrementalCopy": undefined,
         "destinationSnapshot": undefined,
         "deletedOn": undefined,
         "remainingRetentionDays": undefined,
         "accessTier": "Hot",
         "accessTierInferred": true,
         "archiveStatus": undefined,
         "customerProvidedKeySha256": undefined,
         "encryptionScope": undefined,
         "accessTierChangedOn": "2026-01-27T17:30:22.000Z",
         "tagCount": undefined,
         "expiresOn": undefined,
         "isSealed": undefined,
         "rehydratePriority": undefined,
         "lastAccessedOn": undefined,
         "immutabilityPolicyExpiresOn": undefined,
         "immutabilityPolicyMode": undefined,
         "legalHold": undefined
      },
      "metadata": undefined,
      "blobTags": undefined,
      "objectReplicationMetadata": undefined,
      "hasVersionsOnly": undefined,
      "tags": undefined,
      "objectReplicationSourceProperties": undefined,
      "path": "test.txt"
   },
   {
      "name": "test2.txt",
      "deleted": undefined,
      "snapshot": undefined,
      "versionId": undefined,
      "isCurrentVersion": undefined,
      "properties": {
         "createdOn": "2026-01-27T17:30:22.000Z",
         "lastModified": "2026-01-27T17:30:22.000Z",
         "etag": "0x22AF2A6A236E8C0",
         "contentLength": 8,
         "contentType": "application/octet-stream",
         "contentEncoding": undefined,
         "contentLanguage": undefined,
         "contentMD5": "<Buffer ef 65 4c 40 ab 4f 17 47 fc 69 99 15 d4 f7 09 02>",
         "contentDisposition": undefined,
         "cacheControl": undefined,
         "blobSequenceNumber": undefined,
         "blobType": "BlockBlob",
         "leaseStatus": "unlocked",
         "leaseState": "available",
         "leaseDuration": undefined,
         "copyId": undefined,
         "copyStatus": undefined,
         "copySource": undefined,
         "copyProgress": undefined,
         "copyCompletedOn": undefined,
         "copyStatusDescription": undefined,
         "serverEncrypted": true,
         "incrementalCopy": undefined,
         "destinationSnapshot": undefined,
         "deletedOn": undefined,
         "remainingRetentionDays": undefined,
         "accessTier": "Hot",
         "accessTierInferred": true,
         "archiveStatus": undefined,
         "customerProvidedKeySha256": undefined,
         "encryptionScope": undefined,
         "accessTierChangedOn": "2026-01-27T17:30:22.000Z",
         "tagCount": undefined,
         "expiresOn": undefined,
         "isSealed": undefined,
         "rehydratePriority": undefined,
         "lastAccessedOn": undefined,
         "immutabilityPolicyExpiresOn": undefined,
         "immutabilityPolicyMode": undefined,
         "legalHold": undefined
      },
      "metadata": undefined,
      "blobTags": undefined,
      "objectReplicationMetadata": undefined,
      "hasVersionsOnly": undefined,
      "tags": undefined,
      "objectReplicationSourceProperties": undefined,
      "path": "test/test2.txt"
   },
   {
      "name": "test3.txt",
      "deleted": undefined,
      "snapshot": undefined,
      "versionId": undefined,
      "isCurrentVersion": undefined,
      "properties": {
         "createdOn": "2026-01-27T17:30:22.000Z",
         "lastModified": "2026-01-27T17:30:22.000Z",
         "etag": "0x1D4075348288960",
         "contentLength": 27,
         "contentType": "application/octet-stream",
         "contentEncoding": undefined,
         "contentLanguage": undefined,
         "contentMD5": "<Buffer 3e ce 5d f1 05 b7 e4 0d c2 57 72 4e 80 d1 25 bb>",
         "contentDisposition": undefined,
         "cacheControl": undefined,
         "blobSequenceNumber": undefined,
         "blobType": "BlockBlob",
         "leaseStatus": "unlocked",
         "leaseState": "available",
         "leaseDuration": undefined,
         "copyId": undefined,
         "copyStatus": undefined,
         "copySource": undefined,
         "copyProgress": undefined,
         "copyCompletedOn": undefined,
         "copyStatusDescription": undefined,
         "serverEncrypted": true,
         "incrementalCopy": undefined,
         "destinationSnapshot": undefined,
         "deletedOn": undefined,
         "remainingRetentionDays": undefined,
         "accessTier": "Hot",
         "accessTierInferred": true,
         "archiveStatus": undefined,
         "customerProvidedKeySha256": undefined,
         "encryptionScope": undefined,
         "accessTierChangedOn": "2026-01-27T17:30:22.000Z",
         "tagCount": undefined,
         "expiresOn": undefined,
         "isSealed": undefined,
         "rehydratePriority": undefined,
         "lastAccessedOn": undefined,
         "immutabilityPolicyExpiresOn": undefined,
         "immutabilityPolicyMode": undefined,
         "legalHold": undefined
      },
      "metadata": undefined,
      "blobTags": undefined,
      "objectReplicationMetadata": undefined,
      "hasVersionsOnly": undefined,
      "tags": undefined,
      "objectReplicationSourceProperties": undefined,
      "path": "test/folder1/test3.txt"
   }
]

Get

Get one or more blobs with its data

// Gets a blob with name/path test.txt
await blobStorageClient.get('test.txt')

// Yields
{
  name: 'test.txt',
  path: 'test.txt',
  extension: 'txt',
  data: 'testdata'
}

// Gets a blob with name/path test.txt
await blobStorageClient.get('test/')

// Yields
[
  {
    name: 'test2.txt',
    path: 'test/test2.txt',
    extension: 'txt',
    type: 'plain/test',
    encoding: 'utf-8',
    data: 'data:plain/text;utf-8,test2'
  },
  {
    name: 'test3.txt',
    path: 'test/folder1/test3.txt',
    extension: 'txt',
    type: 'plain/test',
    encoding: 'utf-8',
    data: 'data:plain/text;utf-8,test3'
  }
]

Specify encoding of return value

If you for example need get to return base64 instead of a buffer string, you can specify encoding.

See valid encodings in NodeJs official documentation

// Gets a blob with name/path test.pdf and returns the content as a base64 string
await blobStorageClient.get('test.pdf', 'base64')

// Yields
const result = {
  name: 'test.pdf',
  path: 'test.pdf',
  extension: 'pdf',
  data: 'JVBERi0xLjQNCiX5+pr==....'
}

Move

Moves one blob from sourcePath to destinationPath

// Moves the blob from test.txt to moved/test.txt
await blobStorageClient.move('test.txt', 'moved/test.txt');

// Yields
'moved/test.txt'

Remove

Removes one or more blobs matching the provided path

// Removes the blob with path test.txt
await blobStorageClient.remove('test.txt');

// Yields
[ 'test.txt' ]

// Removes all blobs starting with test
await blobStorageClient.remove('test');

// Yields
[ 'test/test2.txt', 'test/folder1/test3.txt' ]

// Removes all blobs starting with test except test3.txt
await blobStorageClient.remove('test', ['test3.txt']);

// Yields
[ 'test/test2.txt' ]

BlobServiceClient

If you need to work with lower-level API's you can create a BlobServiceClient and/or ContainerClient yourself.

// Create the BlobServiceClient
const blobServiceClient: BlobServiceClient = new BlobServiceClient(...);

// Create the ContainerClient
const containerClient: ContainerClient = new ContainerClient(...);