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

mcu-delaygen

v0.2.0

Published

MCU delay routine generator with a web UI and bundled CLI

Readme

MCU Delay Generator

MCU delay routine generator with:

  • a Web UI built with Vite + Preact
  • a bundled CLI published as mcu-delaygen

Features

  • Generates blocking C delay routines for three MCU families:
    • ATmega328P (AVR 8-bit, Arduino Uno) -- default clock 16 MHz
    • STC89C52 (classic 12T 8051) -- default clock 11.0592 MHz
    • STM32F103C8 (ARM Cortex-M3, Blue Pill) -- default clock 72 MHz
  • Two generation modes per MCU:
    • Timer mode -- uses a hardware timer (Timer1 CTC on AVR, Timer0 mode-1 on 8051, SysTick on STM32); handles delays longer than one timer period by chaining multiple timer intervals
    • Software loop mode -- generates a busy-wait loop with a configurable cycles-per-iteration calibration value so the output can be tuned against hardware measurements
  • Accepts arbitrary delay strings (500us, 10ms, 2s) and custom clock frequencies
  • Supports a custom function name in the generated output
  • All arithmetic uses integer bigint throughout -- no floating-point rounding errors
  • Available as a browser-based Web UI (no installation) and a Node.js CLI (mcu-delaygen)

Requirements

  • Node.js 20.19+ or 22.12+
  • Bun for development and tests
  • chafa
  • zip for generating the Web release archive

chafa is only required when regenerating the CLI icon banner from the SVG favicon. The Node.js floor matches the current Vite 8 / Rolldown toolchain used by this repository.

Install

Install the published CLI from bun:

bun install -g mcu-delaygen

or use npm:

npm install -g mcu-delaygen

Or download release assets from Codeberg Releases:

https://codeberg.org/xchacha20-poly1305/mcudelay-gen/releases

Development Setup

bun install

Development

Run the Web app in dev mode:

bun run dev

Run the CLI entrypoint from source:

bun run cli -- version
bun run cli -- list
bun run cli -- generate --mcu stc89c52 --delay 10ms

Build Guide

Web Build

Build the Web app:

bun run build

Output:

  • dist/

Preview the built Web app locally:

bun run preview

CLI Build

Build the bundled CLI:

bun run build:cli

Output:

  • dist-cli/cli.js

Run the built CLI directly:

node ./dist-cli/cli.js version

Build all release assets in one pass:

bun run build:release

Output:

  • versioned single-file JS CLI
  • mcu-delaygen-web-v<version>.zip
  • mcu-delaygen-v<version>-checksums.txt

Release Flow

Push a semver tag that matches package.json:

git tag v0.1.0
git push origin v0.1.0

The Forgejo workflow will:

  • verify the tag matches package.json
  • run the test suite
  • build release assets
  • publish a Codeberg release
  • publish the npm package

Icon Generation

The project icon source is:

  • public/favicon.svg

It is used in two places:

  • the Web app favicon and page branding
  • the CLI version banner

The CLI banner is generated into:

  • src/adapters/cli/generated-banner.ts

When public/favicon.svg changes, regenerate the CLI banner before rebuilding the CLI:

bun run build:banner
bun run build:cli

Equivalent direct command:

node ./scripts/build-cli-banner.mjs

The banner generator uses chafa with symbol output and truecolor mode to preserve the original icon colors in terminal output.

Test

Run the full test suite:

bun test

Lint and Format

Lint the source:

bun run lint

Auto-format the source:

bun run format

Both use Biome. Configuration is in biome.json.