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

@latido/core

v0.5.0

Published

Core scheduler and signal pipeline for Latido.

Downloads

1,324

Readme

@latido/core

Core engine for Latido, a renderer-agnostic rhythm-driven UI engine for the web.

Turn signals into living interfaces.

Latido demo

Documentation · GitHub

Install

npm install @latido/core

Usage

import { createLatido } from "@latido/core"

const latido = createLatido()

latido.source("scroll.progress", () => window.scrollY)

latido.signal("scroll.progress")
  .normalize(0, 800)
  .clamp(0, 1)
  .bind(value => {
    document.body.style.setProperty("--scroll", value)
  })

latido.start()

Latido core provides the scheduler, sources, signals, transforms, and plugin API. It does not render scenes, store application state, or transport data.

Simple signal pipes

Most mappings do not need a custom inline pipeline.

import { signalPipe } from "@latido/core"

const pipe = signalPipe.normalized(-4, 36, 0.08)

pipe(latido.signal("weather.temperature"))
  .bind(value => {
    document.body.style.setProperty("--tone", value)
  })

signalPipe helpers are plain functions that receive a Latido signal and return the transformed signal:

pipe: signalPipe.normalized(-4, 36, 0.08)
pipe: signalPipe.clamped(0.1)
pipe: signalPipe.smooth(0.04)
pipe: signalPipe.zero()
pipe: signalPipe.constant(1)
pipe: signalPipe.beat(0.2, 280, 0.1)
pipe: signalPipe.raw()

Custom pipes still work:

pipe: source => source
  .normalize(0, 100)
  .map(value => value * value)
  .smooth(0.1)

Rule Utilities

Core also exports pure helpers for custom interpretation layers. They are generic building blocks; Latido does not ship market, weather or health rules.

import {
  clamp,
  collectRisks,
  createBaseHealth,
  previousValues,
  read,
  readOr,
  scoreFromFactors
} from "@latido/core"
  • clamp(value, min, max): restricts a number to a range.
  • read(values, name): reads a finite number or returns 0.
  • readOr(values, name, fallback): reads a finite number or returns a fallback.
  • previousValues(history): returns the latest value snapshot from a history buffer.
  • scoreFromFactors(initial, factors, context): combines named scoring factors and clamps the result.
  • collectRisks(groups, context): collects labels from matching grouped rules.
  • createBaseHealth(system, score, risks, metrics): creates a normalized scored-state descriptor.

Health Interpreter

createHealthInterpreter turns domain base scores into temporal states. It handles history, trend detection, instability trend detection, hysteresis, minimum state duration, recovering/unstable transitions and intensity. Your app still owns domain-specific scoring and text.

import { createHealthInterpreter } from "@latido/core"

const interpretHealth = createHealthInterpreter({
  deriveBase(system, values, history) {
    return deriveWeatherBase(values, history)
  },
  reasonFor(state, base, temporal) {
    if (state === "recovering") return "Recovering after sustained weather stress"
    if (base.domainRisks.includes("high wind")) return "High wind and precipitation"
    return "Stable conditions"
  }
})

const health = interpretHealth("weather", values, history)

Adapters

Adapters translate domain-specific data into a stable signal contract. This lets an interface keep the same bindings while swapping audio, browser events, weather, biology, or any other source domain.

const latido = createLatido().adapt("hmi", {
  initial: "weather",
  adapters: {
    weather: {
      label: "Weather",
      read(context) {
        return {
          energy: 0.7,
          pulse: 0,
          flow: 0.4,
          volatility: 0.2,
          phase: context.time * 0.00004,
          primary: 0.6,
          secondary: 0.5,
          tertiary: 0.1
        }
      }
    },
    biology: {
      label: "Biology",
      read() {
        return {
          energy: 0.8,
          pulse: 1,
          flow: 0.6,
          volatility: 0.15,
          phase: 0,
          primary: 0.7,
          secondary: 0.65,
          tertiary: 0.8
        }
      }
    }
  }
})

latido.signal("hmi.energy").bind(value => {
  document.body.style.setProperty("--energy", value)
})

latido.useAdapter("hmi", "biology")

By default, adapter values are clamped to 0..1, and phase wraps around 0..1.