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

kayo-js

v0.0.2

Published

## Install ```sh npm install kayo-js ```

Readme

Kayo npm version

Install

npm install kayo-js

Example

Queue

const Queue = require('../lib/queue');

function taskA(arg) {
  console.log(`taskA(${arg})`);
  return 'result of A';
}

function taskB(arg) {
  return new Promise((resolve) => {
    setTimeout(resolve, 100);
  }).then(() => {
    console.log(`taskB(${arg})`);
    return 'result of B';
  });
}

async function taskC(arg) {
  console.log(`taskC(${arg})`);
  return 'result of C';
}

function taskD(arg) {
  console.log(`taskD(${arg})`);
  return 'result of D';
}

const queue = new Queue();
queue.push(taskA);
queue.push(taskB);
queue.push(taskC);
setTimeout(() => {
  queue.push(taskD);
}, 1000);

output

taskA(null)
taskB(result of A)
taskC(result of B)
taskD(result of C)

Slot

const Slot = require('../lib/slot');

const slot = new Slot();
slot.initialize(['a', 'b', 'c'], (values) => {
  console.log('fulfilled:\n', JSON.stringify(values, null, 2));
});

setTimeout(() => {
  slot.fill('a', 'value of a');
  console.log('fill a');
}, 20);

setTimeout(() => {
  slot.fill('b', 'value of b');
  console.log('fill b');
}, 0);

slot.fill('c', 'value of c');
console.log('fill c');

output

fill c
fill b
fill a
fulfilled:
 {
  "keys": [
    "a",
    "b",
    "c"
  ],
  "values": {
    "c": "value of c",
    "b": "value of b",
    "a": "value of a"
  }
}

API

Queue

Run task by order asynchronously.

constructor()

Create a queue.

push(task: Function): void

Push a task into queue.

task
task(void): void

Slot

Create a slot and run callback after all slot keys are filled.

constructor()

Create a slot.

initialize(keys: Array, callback: Function, onCancel: Function)

Initialize the slot.

keys

Array of keys

callback

Receive slot keys and the value filled with.

callback({ keys: [], values: {} })
onCancel

Receive the message passing to cancel function.

onCancel(message)

fill(key: String, value: any)

Fill slot with value.

cancel(message: any)

Cancel the slot and trigger onCancel function.