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

picostack

v2.0.2

Published

Minimal Web8 Framework

Downloads

15

Readme

 _ __  (_)  ___  ___   ___ | |_  __ _   ___ | | __
| '_ \ | | / __|/ _ \ / __|| __|/ _` | / __|| |/ /
| |_) || || (__| (_) |\__ \| |_| (_| || (__ |   <
| .__/ |_| \___|\___/ |___/ \__|\__,_| \___||_|\_\
|_|  network without super node

If you stash your entire Backend inside Frontend you get "Blockend".

This is a toolkit to build P2P application cores, using emepheral states.

Why do we need yet another consensus engine in 202x? Well this one provides a non-token based approach to decentralization (and also it runs in frontend/-user device with finite resources).

The General Idea In a picoverse nothing is permanent, blocks dissapear, chains corrupt, states across nodes differ. The global state exists but is considered "non computable", so each node attempts to gather and forward as many valid block sequences as it can hold, discarding lesser along the way. In bc-terms pico could be called an intricate mempool that gives you fine control over computing states that "could be".

This kit exposes a higher level API to quickly design and test what ever consensus you imagine. If you stumble on a local state that you wish to persist as truth, you can of course copy the pico-blocks to what ever medium you like. Their format is binary and quite space-efficient.

Update 2024 After a lot of iterations picostore 3.x is starting to emerge. In hindsight I would have liked to rename some components like stack => core-kit and store => block-engine, it makes more sense.

[live demo]

core components

  • picofeed Ultra-portable secure feed/chain-of-blocks
  • picostore block engine w/ garbarge collector.
  • piconet Internet Protocol redesigned for P2P, provides a stateless and easy to use alternative to network streams.
  • Modem56 hyperswarm to pico-net converter.
  • nuro A pure functional approach to reactive store pattern, design your own reactive neural pathways, completely framework agnostic.
  • HyperSimulator Run dat/hyper-apps in an in-memory swarm and watch the chaos unfold.
  • picorepo Lightweight persistent block store ontop of leveldb/leveljs.

Quickstart

Use the project template:

npx degit telamon/pico-template my-project

Check the README.md in the generated folder.

usage

Extend SimpleKernel when starting new.

// blockend.js
import { SimpleKernel } from 'picostack'
const { decodeBlock } = SimpleKernel

class Kernel extends SimpleKernel {
  constructor(db) {
    super(db)

    // Register reducer - see picostore docs
    this.store.register({
      name: 'clock', // slice name
      initialValue: 0, // initial state
      filter ({ block }) { // network-consensus
        const { type, time } = decodeBlock(block.body)
        if (type !== 'tick') return true // silent ignore
        if (time > Date.now()) return 'TimestampFromFuture'
      },
      reducer ({ block }) { // mutate state
        const { time } = decodeBlock(block.body)
        return time
      }
    })
  }

  // Create action
  async createTick () {
    const feed = await this.createBlock(
      'tick', // BlockType:string
      { time: Date.now() } // Payload:any
    )
    return feed.last.sig // block-id
  }
}

async function main() {
  // Spawn 2 peers
  const alice = new Kernel(memdown())
  await alice.boot()

  const bob = new Kernel(memdown())
  await bob.boot()

  // Attach state-observers
  alice.store.on('clock', state => console.log('Alice:', state))
  bob.store.on('clock', state => console.log('Bob:', state))

  // Wire up
  alice.spawnWire()(bob.spawnWire())

  await alice.createTick()
  // Both kernels logs new state
}
main().catch(console.error)

Ad

|  __ \   Help Wanted!     | | | |         | |
| |  | | ___  ___ ___ _ __ | |_| |     __ _| |__  ___   ___  ___
| |  | |/ _ \/ __/ _ \ '_ \| __| |    / _` | '_ \/ __| / __|/ _ \
| |__| |  __/ (_|  __/ | | | |_| |___| (_| | |_) \__ \_\__ \  __/
|_____/ \___|\___\___|_| |_|\__|______\__,_|_.__/|___(_)___/\___|

If you're reading this it means that the docs are missing or in a bad state.

Writing and maintaining friendly and useful documentation takes
effort and time.

  __How_to_Help____________________________________.
 |                                                 |
 |  - Open an issue if you have questions!         |
 |  - Star this repo if you found it interesting   |
 |  - Fork off & help document <3                  |
 |  - Say Hi! :) https://discord.gg/8RMRUPZ9RS     |
 |.________________________________________________|

ZEN.md

Word of advice to the brave, this code was written mainly during tired off-hours, it is intristically minimalistic and mostly dependency free.

Best code, no code:

  • standard - no semis
  • spaces until tabs.
  • Uint8Array > Buffer
  • JSDoc types on plebic APIs

That's it.. sorry.

License

AGPL-3.0-or-later

2022 © Tony Ivanov