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

@solarpunkltd/file-manager-lib

v1.0.4

Published

A file manager for storing and handling data on Swarm.

Readme

File Manager Library

@solarpunkltd/file-manager-lib is a TypeScript/JavaScript library for storing and handling files on Swarm. It builds on Bee to provide:

  • Drives — logical containers backed by postage stamps.
  • Files — uploaded as manifests, stored in feeds, versioned automatically.
  • Access Control (ACT) — enforceable read/unwrapping via publisher + history address.
  • Versioning — restore any historical version to head.
  • Soft delete / recover / forget — manage lifecycle without losing underlying Swarm data.
  • Sharing — manage grantees and share notifications.
  • Browser + Node.js support — unified API.

Full method-level documentation: see REFERENCE.md. Test coverage and usage patterns: see TESTS.md.


Installation

npm install @solarpunkltd/file-manager-lib

Peer dependency: @ethersphere/bee-js


Running a Bee Node

The library requires a running Bee node with postage stamps available.

Local Development (Dev Mode)

bee dev --cors-allowed-origins="*"
  • Runs with in-memory chequebook.
  • Useful for testing and development.

Mainnet / Production

bee start --config bee.yaml
  • Requires full Bee setup (swap, chequebook, persisted DB).
  • Ensure you have purchased real postage stamps with BZZ on mainnet.

Postage Stamps

You need an active postage stamp to upload data.

Install CLI

npm install -g @ethersphere/swarm-cli

List existing stamps

swarm-cli stamp list

Buy a new stamp

swarm-cli stamp buy --amount 100000000000 --depth 20 --label admin
  • --label admin will make this stamp the admin drive automatically.

Quick Start Example

import { Bee } from '@ethersphere/bee-js';
import { FileManagerBase } from '@solarpunkltd/file-manager-lib';

const bee = new Bee('http://localhost:1633', { signer });
const fm = new FileManagerBase(bee);
const adminBatchId = new BatchId('your-admin-batchId');
// purchase an 'admin' stamp, and a 'My Drive' stamp in the background,
// or use beeApi to purchase the stamp inline before initialization
// initialize drives & topics
await fm.initialize(adminBatchId);

// create an admin drive
await fm.createDrive(adminBatchId, 'admin', true);
// create a drive (non-admin)
await fm.createDrive('<BATCH_ID>', 'My Drive', false);

// upload directory
const uploaded = await fm.upload(fm.driveList[0], { info: { name: 'docs' }, path: './docs' });

// list + download
const fi = fm.fileInfoList.find((f) => f.name === 'docs')!;
const list = await fm.listFiles(fi, {
  actHistoryAddress: fi.file.historyRef,
  actPublisher: fi.actPublisher,
});
const data = await fm.download(fi, ['README.md'], {
  actHistoryAddress: fi.file.historyRef,
  actPublisher: fi.actPublisher,
});

Browser differences

  • Use { files: FileList } instead of { path }.
  • download() returns ReadableStream[] instead of Bytes[].

Scripts

From package.json:

  • npm run build → compile Node + browser + types.
  • npm test → run Jest integration tests (see TESTS.md).
  • npm run lint / npm run lint:fix → linting.
  • npm run build:browser → bundle with Vite.

Troubleshooting

  • Admin stamp not found → buy a new stamp and label it admin.
  • File not found → ensure correct directory path or FileList provided.
  • Postage expired → buy a new one and re-initialize.
  • CORS mismatch → align --cors-allowed-origins in Bee with your frontend origin.
  • ACT unwrap errors → ensure both actPublisher and actHistoryAddress are passed.

License

TBD