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

@virid/std

v0.0.1

Published

The virid standard library provides commonly used features in development

Downloads

7

Readme

@virid/std

@virid/std is the official standard library for @virid/core. It provides a set of out-of-the-box utility message control flow operations, featuring native support for asynchronous streams, message grouping, debouncing, throttling, and more.

🔌 Enabling the Plugin

import { createVirid, Component, System, EventMessage } from "@virid/core";
import { nextTick, StdPlugin } from "@virid/std";

const app = createVirid().use(StdPlugin, {});

🛠️ @virid/std Core API Overview

nextTick

  • Function: Similar to nextTick in Vue, but refers to a Virid Macro Tick. When executed, all synchronous Systems within the current Tick have finished running. For asynchronous control, use the @AsyncQueue decorator.
  • Example:
nextTick(() => {
  IncreaseBMessage.send();
  IncreaseAMessage.send();
  IncreaseBMessage.send();
});

@AsyncQueue(key: string)

  • Function: Provides out-of-the-box asynchronous message control. It accepts a key parameter; messages sharing the same key are executed in strict sequential order, preventing asynchronous race conditions.
  • Example:

TypeScript

@AsyncQueue("increase")
class IncreaseAMessage extends EventMessage {}

@AsyncQueue("increase")
class IncreaseBMessage extends EventMessage {}

@AsyncQueue("decrease")
class DecreaseMessage extends EventMessage {}

// Messages sent in the following order:
// Because IncreaseAMessage and IncreaseBMessage share the same key,
// they will execute sequentially even if they contain async operations.
IncreaseAMessage.send();
IncreaseBMessage.send();
IncreaseAMessage.send();

// Since DecreaseMessage has a different key, it does not wait for the above.
// However, the three DecreaseMessages below will execute in their own sequence.
DecreaseMessage.send();
DecreaseMessage.send();
DecreaseMessage.send();

executeGroup

  • Function: A collection of messages that executes a group in strict sequential order. If an error occurs during execution, subsequent logic is cancelled.
  • Example:
const success = await executeGroup(
  [
    new IncreaseAMessage(),
    new IncreaseBMessage(),
    new IncreaseAMessage(),
    new DecreaseMessage(),
  ],
  "first"
);

if (success) {
  console.log("[ExecuteGroup] Success");
} else {
  console.log("[ExecuteGroup] Failed");
}

@Debounce() / @Throttle()

  • Function: Out-of-the-box support for debouncing and throttling. Can be implemented with a single line of code.
  • Example:
// 100ms Debounce: Executes only once after 100ms of inactivity.
// The second parameter is used to aggregate messages.
@Debounce(100, (current, next) => {
  current.val += next.val;
})
class SetTimerAMessage extends EventMessage {
  constructor(public val: number) {
    super();
  }
}

// 500ms Throttle: Limits execution to once every 500ms.
@Throttle(500)
class IncreaseBMessage extends EventMessage {}