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

@edgeone/pages-blob

v0.0.7

Published

Blob storage SDK for EdgeOne Pages functions

Readme

@edgeone/pages-blob

Blob storage SDK for EdgeOne Pages Functions, providing persistent key-value storage across deployments.

Installation

npm install @edgeone/pages-blob

Usage

Inside Pages Functions (automatic authentication)

import { getStore } from "@edgeone/pages-blob";

const store = getStore("my-store");

// Write
await store.set("key", "value");
await store.setJSON("config", { theme: "dark" });

// Read
const text = await store.get("key");
const json = await store.get("config", { type: "json" });

// Delete
await store.delete("key");

// List
const { blobs } = await store.list({ prefix: "users/" });

External access (API Token mode)

When calling from outside Pages Functions, you must supply both token and projectId:

const store = getStore({
  name: "my-store",
  projectId: "pages-urtsvuwmfvli", // required
  token: "c+KH5...", // required
});

Omitting projectId throws MissingProjectIdError.

Strong consistency (read-after-write)

By default reads use eventual consistency (CDN-cached, lower latency). To guarantee read-after-write consistency, use "strong":

// Store-level default — all reads use strong consistency
const store = getStore({ name: "my-store", consistency: "strong" });

// Per-call override
await store.get("key", { consistency: "strong" });
await store.list({ consistency: "strong" });

"eventual" (the default) has lower latency; "strong" guarantees the freshest value at the cost of bypassing the cache layer.

List all stores

import { listStores } from "@edgeone/pages-blob";

// Inside Pages Functions
const { stores } = await listStores();

// External access (token mode) - both fields required
const { stores } = await listStores({
  projectId: "pages-urtsvuwmfvli",
  token: "c+KH5...",
});

API

getStore(name | options)

Get a Store instance.

| Parameter | Type | Description | | --------------------- | ------------------------ | ----------------------------------------------- | | name | string | Store name | | options.name | string | Store name | | options.projectId | string | Project ID (required for external access) | | options.token | string | Access token (required for external access) | | options.consistency | "eventual" \| "strong" | Default read consistency (default "eventual") |

store.set(key, value, options?)

Write a Blob. value supports string | ArrayBuffer | Blob | ReadableStream.

  • options.onlyIfNew: only write if the key does not already exist

store.setJSON(key, value, options?)

Write JSON (serialized automatically). Accepts the same options as store.set.

store.get(key, options?)

Read a Blob. Returns null if it does not exist.

  • options.type: "text" (default) | "json" | "arrayBuffer" | "blob" | "stream"
  • options.consistency: "eventual" | "strong" (overrides Store-level default)

store.getWithHeaders(key, options?)

Read a blob along with all response headers. Returns null if the key does not exist.

Returns: { body: string, headers: Record<string, string> }

  • options.consistency: "eventual" | "strong"

store.delete(key)

Delete a Blob.

store.list(options?)

List Blobs. Automatically aggregates all pages by default.

  • options.prefix: prefix filter
  • options.directories: group by directory
  • options.paginate: set to false for manual pagination
  • options.cursor: resume from a previous pagination cursor
  • options.consistency: "eventual" | "strong"

Returns: { blobs: Array<{ key, etag }>, directories: string[] }

listStores(options?)

List all Stores under the project.

  • options.projectId: Project ID (required for external access)
  • options.token: Access token (required for external access)
  • options.consistency: "eventual" | "strong"

Returns: { stores: Array<{ name: string }> }