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

@peer-ring/core

v1.1.0

Published

Distributed, Decentralized Sharding Framework for building Peer-to-Peer Systems

Downloads

39

Readme

peer-ring

Distributed, Decentralized Sharding Framework for building distributed storage or similar solutions, inspired by Amazon Dynamo

Peer-ring is designed to be storage or use case agnostic. It acts as a base framework for building distributed solutions. Some sample applications that can be built on top of peer-ring include:

  • [x] Distributed KV store: In-memory key-value store.
  • [ ] Distributed Rate Limiter: Rate limiter that can be deployed close to your application for greater performance.
  • [ ] Distributed Pub-Sub: In-memory pub-sub/queue system for application synchronization. ... and many more.

read more about the project here

Unless you are developing a distributed application on top of peer-ring, you most likely wont use this package directly, you might be interested in Distributed KV store.

  1. install
npm i @peer-ring/core @peer-ring/discovery-k8s
  1. use
import { K8sPeerDiscovery } from "@peer-ring/discovery-k8s";
import {
  type CommandHandler,
  PeerRing,
  buildLogger,
  type PeerRingOpts,
  ExecuteOpts,
} from "@peer-ring/core";

const watchQueryParams = { labelSelector: `app=your-awesome-app` };

const discovery = new K8sPeerDiscovery({
  watchQueryParams,
});

const peerRing = new PeerRing({
  peerDiscovery: discovery,
  // ...more_opts
});

await peerRing.initRing();

//the command handle will be executed on the peer where the key is sharded
await peerRing.registerCommand({
  namespace: "my_app",
  command: "set",
  handler: (key: string, payload?: string) => {},
});

// Start executing commands
// peering will exxecute the command on current node if its the owner of the key if not it will execute it on the peer node and gives the response back from the handler registered above
await peerRing.execute({
  namespace: "my_app",
  command: "set",
  key: "k1",
  payload: "anything",
});

generated types for peerRingOpts can be found here