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

distributed-drive

v0.1.1

Published

Drive-compatible unified view across multiple peers and drives over RPC

Readme

distributed-drive

A drive-compatible unified view across multiple peers and drives over RPC. Connect your devices, register drives, and browse everything as one folder.

Note: This module was AI-generated with Claude and may need adjustments. Review before use in production.

Usage

const Hyperswarm = require('hyperswarm')
const Localdrive = require('localdrive')
const DistributedDrive = require('distributed-drive')

const drive = new DistributedDrive(new Localdrive('./movies'), new Localdrive('./music'))

const swarm = new Hyperswarm()
swarm.join(topic)

swarm.on('connection', (stream) => drive.addPeer(stream))

// unified view — local + remote files merged
for await (const entry of drive.list('/')) {
  console.log(entry.key)
}

const buf = await drive.get('/photos/beach.jpg')

Try it

On machine A:

node run.js

On machine B (using the key printed by A):

node run.js <key>

Share a specific directory:

node run.js -p ~/movies
node run.js <key> -p ~/photos

REPL commands

ls [path]           list files
cat <path>          print file contents
cp <path> [dest]    copy remote file locally
find <query>        search filenames
peers               show connected peers
exit                quit

API

new DistributedDrive(...drives, [opts]) — create a drive, optionally registering drives upfront.

drive.register(drive) / drive.unregister(drive) — add or remove a local drive.

drive.addPeer(stream) — add an encrypted stream from Hyperswarm. Opens a protomux-rpc channel. Peer is removed automatically on stream close.

await drive.entry(path) — get entry metadata. Checks local drives, then cache, then fans out to peers.

await drive.get(path) — get file contents as a buffer. Same lookup order.

drive.list(prefix) — readable stream of entries merged from all drives and peers, deduplicated by key.

drive.createReadStream(path) — readable stream of file contents.

How it works

Each peer connection is symmetric — both sides share their registered drives and can query the other's. There is no client/server distinction. Metadata is cached lazily with record-cache and disconnected peers are filtered on read. The RPC protocol uses hyperschema for encoding and protomux-rpc for transport.

Security is handled below this module — Hyperswarm connections are encrypted via secret-stream. The swarm topic acts as the shared secret.

License

Apache-2.0