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

simple-whisper

v1.0.0

Published

Simple Web3 Whisper API

Readme

simple-whisper

Web3 Whisper made simple.

(A demo will be released when metamask upgrades to Web3 1.0)

install

npm install simple-whisper
#or
yarn add simple-whisper

Or include in your html dist/simple-whisper.min.js

This library requiere a Web3 implementation. If the client is not Web3 1.0 ready, you can provide an implementation

npm install web3-1beta
#or
yarn add web3-1beta

You can easily test your code on a private node with docker:

npm run run-local-node
npm run stop-local-node
#or
yarn run-local-node
yarn stop-local-node

use

simple symetric key channel

const u1 = new SimpleWhisper(new Web3(Web3.givenProvider || 'ws://localhost:8546'));
await Promise.all([
    u1.config({topic: "something"}),
    u1.useNewSymKey("somepass")
]);

u1.subscribe({useSymKey: true}, (message) => {
    console.log(message.payload);
    //>{hello: "world"}
});

const u2 = new SimpleWhisper(new Web3(Web3.givenProvider || 'ws://localhost:8546'));
await Promise.all([
    u2.config({topic: "something"}),
    u2.useNewSymKey("somepass")
]);

u2.post({hello: "world"}, {useSymKey: true});

answer an offer

const u1 = new SimpleWhisper(new Web3(Web3.givenProvider || 'ws://localhost:8546'));
await Promise.all([
    u1.config({topic: "token_market"}),
    u1.useNewSymKey("token_market_key"),
    u1.useNewKeyPair()
]);

u1.subscribe({}, (message) => {
    console.log(`${message.payload.name} (${message.authorSig}) accepted our offer !`);
    //
    ...
});

u1.post({id: 1, offer: {unit: "eth", qte: 0.1} demand: {unit: "btc", qte: 0.1}}, {useSymKey: true, ttl: 60});

const u2 = new SimpleWhisper(new Web3(Web3.givenProvider || 'ws://localhost:8546'));
await Promise.all([
    u2.config({topic: "token_market"}),
    u2.useNewSymKey("token_market_key"),
    u2.useNewKeyPair()
]);

u2.subscribe({useSymKey: true}, (message) => {
    // subscribe to messages from u1 to u2
    u2.subscribeBack((messagePers) => {...})

    if(message.payload.unit === "eth" && ...) {
        //answer using u1 pubKey
        message.postBack({name: "sw", id: message.payload.id});
    }
});

asymetric key

const u1 = new SimpleWhisper(new Web3(Web3.givenProvider || 'ws://localhost:8546'));
await Promise.all([
    u1.config({topic: "something"}),
    u1.useNewKeyPair()
]);

const u2 = new SimpleWhisper(new Web3(Web3.givenProvider || 'ws://localhost:8546'));
await Promise.all([
    u2.config({topic: "something"}),
    u2.useNewKeyPair()
]);

u2.setRemotePublicKey(await u1.getPublicKey());
u1.setRemotePublicKey(await u2.getPublicKey());

u1.subscribe({}, (message) => {
    console.log(message.payload);
    //>{hello: "I'm u2"}
});

u2.subscribe({}, (message) => {
    console.log(message.payload);
    //>{hello: "I'm u1"}
});

u1.post({hello: "I'm u1"});
u2.post({hello: "I'm u2"});

API

contribute

  1. Open an issue to discuss about your ideas
  2. Be sure the code 100% tested
  3. Be sure the api's docs are up to date
  4. Make a PR !

If you have created something awesome using simple-whisper, tell me! I'd love to share it!