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

@tty-pt/stele

v1.5.2

Published

Universal Node.js and Browser bindings for libstele system substrate and isomorphic C runtime contracts

Readme

@tty-pt/stele

npm version License: BSD-2-Clause Standards: WebAssembly Reactor

Universal Node.js and Browser bindings for libstele, the zero-dependency system substrate for plain C and isomorphic WebAssembly. Provides high-resolution monotonic clocks, memory diagnostics, and the decoupled CapabilityRegistry plug-and-play contract.


1. Quick Start

Install via npm:

npm install @tty-pt/stele

Usage in modern JavaScript / TypeScript:

import {
  nowMs,
  selfRssBytes,
  CapabilityRegistry,
  WasmSubstrate,
  getSubstrate,
  getSharedWasm
} from "@tty-pt/stele";

// 1. High-Resolution Metrics
console.log(`Current process monotonic time: ${nowMs()} ms`);
console.log(`Resident Set Size (RSS): ${selfRssBytes()} bytes`);

// 2. Capability Registry
const caps = new CapabilityRegistry();
caps.register("audio", (root, wasm) => ({
  play: (url) => console.log("Playing audio:", url)
}));

// 3. WebAssembly Substrate
const substrate = getSubstrate();
console.log("Single-memory substrate initialized:", substrate.memory.buffer.byteLength);

2. JavaScript / TypeScript API Reference

nowMs(): number

Returns a high-resolution monotonic timestamp in milliseconds using the fastest available native clock.

selfRssBytes(): number

Returns the process Resident Set Size (RSS) in bytes.

CapabilityRegistry

Decoupled plug-and-play capability registry mapping feature slots to runtime providers.

  • .register(name: string, provider: Function): this
  • .get(name: string): Function | null
  • .has(name: string): boolean
  • .list(): string[]
  • .unregister(name: string): boolean

WasmSubstrate

Universal single-memory WebAssembly runtime substrate.

  • instance: WebAssembly.Instance: Underlying compiled WASM instance.
  • memory: WebAssembly.Memory: Shared linear memory space across all colocated modules.
  • .malloc(size: number): number: Allocates memory within the substrate.
  • .free(ptr: number): void: Frees memory within the substrate.
  • .encodeString(str: string): [number, number]: Writes UTF-8 string into WASM memory, returning [ptr, byteLength].
  • .kernelBoot(): number: Invokes stl_kernel_boot().
  • .kernelMount(slot: number, name: string, json?: string): number: Mounts module into slot.
  • .kernelAction(slot: number, actionId: number, data?: string): number: Dispatches action to module.

getSubstrate(): WasmSubstrate

Returns the globally shared WasmSubstrate instance, guaranteed to instantiate stele.wasm strictly once per lifecycle.

getSharedWasm(): WebAssembly.Exports

Direct accessor returning the raw exported functions and linear memory of the shared stele.wasm kernel.


3. Isomorphic C Header Packaging

libstele defines the standard isomorphic C capability contract used across the entire tty.pt stack:

  • <ttypt/stele.h>: Cross-platform POSIX/Win32 socket and system shims.
  • <ttypt/iso.h>: Universal ISO_EXPORT and ISO_IMPORT macros for isomorphic C modules compiled natively for SSR and into .wasm for the browser.
  • <ttypt/stele_wasm.h>: Universal single-instantiation WASM kernel substrate and slot orchestration ABI.

When building native Node addons or WebAssembly reactors:

CFLAGS += -I./node_modules/@tty-pt/stele/include
LDLIBS += -lstele