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

wildling

v2.0.7

Published

Pattern based string generator library and CLI

Readme

wildling

TypeScript library and CLI for pattern-based string generation. Runtime has zero npm dependencies (Node.js only); TypeScript is a build-time devDependency.

Docs: Website · Sandbox · Syntax · Source

Registry: npm

Example

http://${'dev,stage,prod'}\-${'api,web'}#{0-2}.example.${'com,net,org'}/@.html

(The \- is a literal hyphen; bare - would mean “one letter or digit”. @ is one lowercase letter.)

That builds URL-shaped candidates: scheme http://, then environment × service × optional digits × TLD, then a one-letter path page. Three environments, two services, zero–two digits ('', 09, 0099), three TLDs, and az51948 strings — the kind of list you generate for fuzzing links or probing staging hosts, not type out.

A few of them:

  • http://dev-api.example.com/a.html / http://stage-web.example.com/z.html
  • http://dev-api0.example.net/a.html / http://prod-web9.example.org/m.html
  • http://dev-api00.example.com/a.html / http://prod-web99.example.org/z.html

Named dictionaries (%{'hosts'}) work the same way when the word lists live in files.

Try it in the sandbox, or see pattern syntax for length ranges, dictionaries, and escapes.

Install

Registry:

npm install wildling

Git (monorepo subdirectory): current npm does not reliably resolve the #tag:subdir / github:…#tag:subdir forms for this repo. Prefer a tagged clone, then install from the javascript/ tree (run npm ci --include=dev && npm run build there first if dist/ is missing):

git clone --branch v2.0.7 --depth 1 https://github.com/dotmonk/wildling.git
cd wildling/javascript
npm ci --include=dev
npm run build
cd /path/to/your-app
npm install /path/to/wildling/javascript

prepare builds dist/ when missing on install (Node 18+, network for TypeScript on first install).

From this repository:

cd javascript
npm ci --include=dev
npm run build

The CLI is ./bin/wildling (or npx wildling after install). The library entry is dist/index.js.

Library

const createWildling = require("wildling").default;
// or: import createWildling from "wildling";

const wildling = createWildling({
  patterns: ["abrakadabra", "Year 19##"],
  dictionaries: {
    colors: ["red", "blue"],
  },
});

wildling.count(); // 101
wildling.get(0); // "abrakadabra"

let value;
while ((value = wildling.next()) !== false) {
  console.log(value);
}

wildling.reset();

Options

| Field | Type | Description | |-------|------|-------------| | patterns | string[] | One or more patterns to expand | | dictionaries | { [name: string]: string[] } | Named word lists for %{'name'} |

API

| Method | Description | |--------|-------------| | next() | Next combination, or false when exhausted | | get(index) | Combination at index, or false if out of range | | count() | Total combinations across all patterns | | index() | Current position (after next calls) | | reset() | Reset iteration to the start | | generators() | Per-pattern generators |

CLI

wildling [options] [pattern ...]

| Option | Description | |--------|-------------| | --select # | Print only combination # (repeatable) | | --range #-# | Print combinations from # to # inclusive (repeatable) | | --check | Print generation info instead of results | | --dictionary <name>:<path> | Load a dictionary file as <name> (repeatable) | | --template <path> | Load options from a JSON template | | --help, -h | Help (shared text from docs/help.txt) | | --version, -v | Version |

--check and help text follow the cross-language contracts in docs/cli.md.

Examples:

./bin/wildling "Year 19##"
./bin/wildling --dictionary planets:../dictionaries/planets.txt "%{'planets'}"
./bin/wildling --select 0 --range 8-9 "##"
./bin/wildling --template ./config.json

Template JSON

{
  "patterns": ["Year 19##", "%{'colors'}"],
  "dictionaries": {
    "colors": "path/to/colors.txt",
    "inline": ["red", "blue"]
  },
  "select": [0, 2],
  "range": ["5-7"],
  "check": false
}

Dictionary values may be a file path or an inline string array. Template fields merge with CLI flags in argument order.

Patterns

Simple wildcards

| Token | Alphabet | |-------|----------| | # | 0-9 | | @ | a-z | | * | a-z and 0-9 | | & | a-zA-Z | | ! | A-Z | | ? | A-Z and 0-9 | | - | a-zA-Z0-9 |

Optional length: #{2}, @{1-2}, *{1-2} (start–end inclusive).

Special wildcards

${'blue,red,green',1-2}   words / punctuation from a list
%{'colors'}               dictionary named "colors"
%{'colors',1-2}           dictionary with length range

Escape a wildcard with a backslash: \###0#9.

Build

npm run build
# or from repo root: ./build.sh  (Docker)

Project tests live in ../tests/ and are run with ../test.sh.