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

wordsmith-engine

v0.4.0

Published

Composable, deterministic-friendly text-generation components for TypeScript and JavaScript.

Readme

Wordsmith Engine for TypeScript

Composable, deterministic-friendly procedural text generation for TypeScript and JavaScript.

The package is dependency-free, ESM-only, browser/bundler friendly, and ships JavaScript plus TypeScript declarations. Wordsmith is fundamentally English-oriented while preserving arbitrary Unicode text.

Install

npm install wordsmith-engine

Generate repeatable text

import { LiteraryTitle, seededRandom } from "wordsmith-engine";

const rng = seededRandom("world:ships:5343");
const title = new LiteraryTitle();

console.log(title.render(rng));

The caller creates and owns the random source, passes it through every nested Wordsmith render, and discards it when that generation operation is complete. Keep unrelated procedural systems on independently derived named streams.

seededRandom accepts strings and finite safe integers. A numeric seed is normalized to its decimal string, so seededRandom(5343) and seededRandom("5343") produce the same TypeScript stream. Seeded output is repeatable within an unchanged TypeScript package, asset set, component tree, configuration, and call order; Python and TypeScript do not promise identical output from the same seed.

A custom RandomSource must return a finite fraction in [0, 1) from each random() call. Custom component() callbacks are replayable only when they use that source and fixed captured configuration; clocks and external mutable state remain the caller's responsibility. Pin the Node.js runtime as well as the package when durable replay includes non-English host case conversion.

Compose components

import { Adjective, Noun, join, seededRandom, ws } from "wordsmith-engine";

const rng = seededRandom("example");
const subject = join([new Adjective(), new Noun()], " ").titleCase();
const sentence = ws`${subject}!`;

console.log(sentence.render(rng));

join(parts, separator) and concat(...parts) render children once from left to right through the same random source. They omit exact empty strings while preserving whitespace-only results. ws is a tagged-template spelling of concat: it preserves template text exactly and adds no spacing or cleanup.

ReadableUniqueIdentifier intentionally includes the current clock and is therefore outside the seed-only replay guarantee.

The generator gallery shows representative names, vessels, fictional materials, and exotic characters generated from independently derived named streams.

Development

npm ci
npm run check

The shared behavioral contract and the Python peer live in the repository.