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 🙏

© 2024 – Pkg Stats / Ryan Hefner

mortable

v2.0.0

Published

In memory eventual consistant distributed data structure

Downloads

12

Readme

mortable

In memory eventual consistant distributed data structure

npm install mortable

build status

Mortable is for sharing data that is only valid as long as your process is alive and small enough to fit in memory (think hostnames+ports for a distributed service registry)

Data will be replicated to other nodes using protobuf messages and the scuttlebutt protocol

Usage

var mortable = require('mortable')
var table = mortable()

table.push('hello', 'world')     // push world to the hello data set
console.log(table.list('hello')) // prints ['world']

var table2 = mortable()

table2.push('hello', 'mundo')

var stream = table.createStream()
stream.pipe(table2).pipe(stream) // start replicating between the two tables

setImmediate(function() {
  console.log(table2.list('hello')) // will print ['world', 'mundo']
})

To replicate the data structure to other nodes use .createStream() and pipe it to a network stream

var stream = table.createStream()

// will start replicating this data structure to other nodes
streamToAnotherPeer.pipe(stream).pipe(streamToAnotherPeer)

If you want to destoy your table call table.destroy() which will remove all local values from the replicas. If you do not call destroy and exits your process the values will be removed after a timeout (~10s)

Credits

Credits to dominictarr for making the excellent scuttlebutt module that inspired this

License

MIT