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

peekeasy

v0.17.0

Published

tools for behavior, delegation, and state in typescript

Downloads

10

Readme

Peekeasy

tools for behavior, delegation, and state in typescript

Contents

Use

install

npm i peekeasy

examples

behavior

import { Behavior } from 'peekeasy'

const behavior = new Behavior([
	async data => (data.message = `Hello, ${data.message}!`),
	async ({ message }) => console.log(message),
])

// Hello, behavior!
behavior({ message: 'behavior' })

delegate

import { Delegate } from 'peekeasy'

const set = new Set<(t: string, u: string) => void>(),
	delegate = new Delegate(set)

delegate.add(async message => console.log(...message))

// Hello, delegate!
set.forEach(f => f('Hello,', 'delegate!'))

reference

import { Reference } from 'peekeasy'

function* generate() {
	while (true) {
		yield 'Hello, reference!'
	}
}

const reference = new Reference(generate())

// Hello, reference!
console.log(`${reference}`)

vector

import { Vector } from 'peekeasy'

const vector = new Vector([{ text: 'Hello,' }, { text: 'vector!' }])

// Hello, vector!
console.log(...vector.text)

Contribute

clone repo

gh repo clone domrally/peekeasy

open directory

cd Documents/Github/peekeasy

download dependencies

npm i

fix and format

npm stop

run tests

npm test

build docs

npm start

deploy

merge a pull request into main to publish to npm

Project

goals

non-goals

  • event system
  • app framework
  • observer pattern
  • finite state machine
  • integration with array programming languages

documentation

https://domrally.github.io/peekeasy

dependencies

internal

classDiagram
    direction LR

    PromiseLike <|.. Promise
    PromiseLike *-- Delegate
    Promise <.. Delegate
    PromiseLike <.. AsyncIterator
    IteratorResult o-- AsyncIterator
    Iterator -- AsyncIterator
    AsyncIterator *-- AsyncIterable
    Iterable -- AsyncIterable
    AsyncIterable *-- Delegate
    IteratorResult o-- Iterator
    Iterator *-- Iterable
    WeakSet -- Set
    WeakSet <|.. Delegate
    Iterator <-- Reference
    Iterable *-- Vector

    class IteratorResult {
        done boolean
        value any
    }

    class AsyncIterable {
        Symbol.asyncIterator() AsyncIterator
    }

    class Iterable {
        Symbol.iterator() Iterator
    }

    class Iterator {
        next() IteratorResult
    }

    class AsyncIterator {
        next() PromiseLike~IteratorResult~
    }

    class PromiseLike {
        then() PromiseLike
    }
	 link PromiseLike "https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_typedoc_node_modules_typescript_lib_lib_es5_d_.promiselike.html" "PromiseLike"

    class Promise {
        finally(onfinally () => void) Promise
    }
	 link Promise "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" "Promise"

    class WeakSet {
        add() WeakSet
        delete() WeakSet
        has() boolean
    }
	 link WeakSet "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet" "WeakSet"

    class Set {
        size number
        clear() void
        forEach() void
    }
    link Set "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set" "Set"

    class Delegate
    link Delegate "https://github.com/domrally/peekeasy/blob/main/src/delegate.ts" "delegate.ts"

    class Vector
    link Vector "https://github.com/domrally/peekeasy/blob/main/src/vector.ts" "vector.ts"

	 class Reference
	 link Reference "https://github.com/domrally/peekeasy/blob/main/src/reference.ts" "reference.ts"

external

structure