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

@storagebus/storage

v1.0.0

Published

[![npm version](https://img.shields.io/npm/v/@storagebus/storage)](https://www.npmjs.com/package/@storagebus/storage) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Readme

@storagebus/storage

npm version License: MIT

Core StorageBus package. It provides Storage, BusFile, the Adapter contract, shared errors, and compliance tests for Adapter packages.

Installation

npm install @storagebus/storage
pnpm add @storagebus/storage
yarn add @storagebus/storage

Usage

import { createAdapter } from '@storagebus/memory'
import { Storage } from '@storagebus/storage'

const storage = new Storage(createAdapter())

const objectKey = await storage.write('hello.txt', 'Hello, world!')
const file = await storage.file(objectKey)

console.log(file.name)
console.log(file.type)
console.log(file.size)
console.log(await file.text())

await storage.write(objectKey, null)

BusFile

BusFile is the value returned by storage.file(objectKey).

| Property or method | Description | |--------------------|-------------| | name | Object Key, exposed as name to match the File-style shape. | | type | Content type, inferred from extension when metadata does not provide one. | | size | File size in bytes. | | lastModified | Last modified timestamp in milliseconds, or -1 when unavailable. | | stream() | Return a Node.js readable stream. | | buffer() | Return a Buffer. | | arrayBuffer() | Return an ArrayBuffer. | | text() | Return a string. |

Custom Adapters

import { Storage, type Adapter } from '@storagebus/storage'

const adapter: Adapter = {
  async set(file) {
    const buffer = await file.buffer()
    // Store buffer at file.name, which is the Object Key.
    return file.name
  },
  async get(objectKey) {
    return () => {
      // Return a Readable for objectKey.
    }
  },
  async metadata(objectKey) {
    return { size: 0, lastModified: -1 }
  },
  async delete(objectKey) {
    // Delete objectKey.
  },
}

const storage = new Storage(adapter)

Migration to v1

The in-memory Adapter moved from @storagebus/storage/memory to @storagebus/memory.

Before v1:

import { createStorage } from '@storagebus/storage/memory'

const storage = createStorage()

In v1:

import { createAdapter } from '@storagebus/memory'
import { Storage } from '@storagebus/storage'

const storage = new Storage(createAdapter())

License

MIT