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

dshell

v1.5.0

Published

Decentralized distribution browser action framework, build-in P2P network and IPFS storage.

Readme

dshell

Decentralized distribution browser action framework, build-in P2P network and IPFS storage.

Install

npm install dshell

Build

NO NEED!

dshell writen under esm module system, but the dependency part current not support esm, hence dshell contains pre-build(use browserify) dep.bundle.min.js file and port it to esm in dep.js file.

Usage

Include dshell dependency first, add below code to your html code:

<script src="/path/to/dshell/dep.bundle.min.js"></script>

or use cdn

<script src="https://cdn.jsdelivr.net/npm/dshell/dep.bundle.min.js"></script>

Then you can import in module script tag:

<script type="module" about="main">
  import shell from '/path/to/dshell/dshell.js'
  document.addEventListener('DOMContentLoaded', async () => {
    await shell.init()
    let response = await shell.exec({action: '/Ping'})
    console.log(response.json()) // => 'pong'
  })
</script>

or use cdn

<script type="module" about="main">
  import shell from 'https://cdn.jsdelivr.net/npm/dshell/dshell.js'
  document.addEventListener('DOMContentLoaded', async () => {
    await shell.init()
    let response = await shell.exec({action: '/Ping'})
    console.log(response.json()) // => 'pong'
  })
</script>

Custom Shell Example

const username = 'demo';
const db = (new datastoreLevel(`dshell/${username}`, { prefix: '' })).db;
const country = '/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star/';
const simplePeerOptions = { trickle: true };
const my = new UserNode(db, username, country, simplePeerOptions);
const soul = new Soul(db, username);
const shell = new Shell(my, soul);
const peers = [];
const intervalCache = {};

async function beatPingPeer(id) {
  await my.pingPeer(id)
}

function log(message) {
  console.log(message)
}

function MeetPeer(id) {
  log(`* Nice to meet ${id}`);

  if (!peers.includes(id)) {
    peers.push(id)
    intervalCache[id] = window.setInterval(async () => await beatPingPeer(id), 3000);
  }
}

function AwayPeer(id) {
  log(`* Bay ${id}`);

  const index = peers.indexOf(id);
  if (index > -1) {
    peers.splice(index, 1);
    window.clearInterval(intervalCache[id]);
    delete intervalCache[id]
  }
}
my.on('user:online', MeetPeer);
my.on('user:offline', AwayPeer);

document.addEventListener('DOMContentLoaded', async () => {
  await db.put('welcome', 'shell');
  db.db.codec.opts.valueEncoding = 'json';
  await my.init();
  window.addEventListener("unload", async () => await my.vegetative());
  await soul.init();
  shell.install();
  shell.installModule(
    'https://cdn.jsdelivr.net/npm/dshell/actions/network.js',
    'https://cdn.jsdelivr.net/npm/dshell/actions/dom.js',
    'https://cdn.jsdelivr.net/npm/dshell/actions/utils.js',
    'https://cdn.jsdelivr.net/npm/dshell/actions/soul.js',
  );
  
  // add action should install before node awake
  shell.installExternalAction(function Add(_, a, b) {
    return a + b
  });
  await my.awake();
});

Open your page in different PC(or just different Chrome User tabs for simulation), then try remote call:

const remote = peers[0] // select a peer id from `peers`
await shell.exec(shell.action(true, {receivers: [remote]})
  .zipArray([Array(10).fill(1), Array(10).fill(2)]) // => [[1, 2], ...]
  .Add.PCollect // => [3, ...]
  .Map // => 3
  .Echo // => "3"
  .Collect // => ["3", ...]
  .zipArray([Array(10).fill(4)]) // => [[4, "3"]]
  .buildExcel(['data', ['number', 'add result']]) // => blob file
  .download({args:['demo.xlsx'], receivers: [my.id]}) // trigger download
  .pushFile(['/tmp/demo.xlsx']) // upload to IPFS storage
  .previewOffice({receivers: [my.id]})) // preview online

API

todo