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

@strling-lang/strling

v3.0.0

Published

Next-gen string pattern DSL & compiler

Readme

STRling - TypeScript Binding

Part of the STRling Project

💿 Installation

npm install @strling-lang/strling

📦 Usage

Here is how to match a US Phone number (e.g., 555-0199) using STRling in TypeScript:

import { simply } from "@strling-lang/strling";

// Start of line.
// Match the area code (3 digits)
// Optional separator: [-. ]
// Match the central office code (3 digits)
// Optional separator: [-. ]
// Match the station number (4 digits)
// End of line.
const s = simply;

const phonePattern = s.merge(
    s.start(),
    s.capture(s.digit(3)),
    s.may(s.anyOf("-", ".", " ")),
    s.capture(s.digit(3)),
    s.may(s.anyOf("-", ".", " ")),
    s.capture(s.digit(4)),
    s.end()
);

const regex = new RegExp(String(phonePattern));
console.assert(regex.test("555-123-4567"));

Note: This compiles to the optimized regex: ^(\d{3})[-. ]?(\d{3})[-. ]?(\d{4})$

🚀 Why STRling?

Regular Expressions are powerful but notorious for being "write-only" code. STRling solves this by treating Regex as Software, not a string.

  • 🧩 Composability: Regex strings are hard to merge. STRling lets you build reusable components (e.g., ip_address, email) and safely compose them into larger patterns without breaking operator precedence or capturing groups.
  • 🛡️ Type Safety: Catch syntax errors, invalid ranges, and incompatible flags at compile time inside your IDE, not at runtime when your app crashes.
  • 🧠 IntelliSense & Autocomplete: Stop memorizing cryptic codes like (?<=...). Use fluent, self-documenting methods like simply.lookBehind(...) with full IDE discovery.
  • 📖 Readability First: Code is read far more often than it is written. STRling patterns describe intent, making them understandable to junior developers and future maintainers instantly.
  • 🌍 Polyglot Engine: One mental model, 17 languages. Whether you are writing Rust, Python, or TypeScript, the syntax and behavior remain identical.

🏗️ Architecture

STRling follows a strict compiler pipeline architecture to ensure consistency across all ecosystems:

  1. Parse: DSL -> AST (Abstract Syntax Tree)
    • Converts the human-readable STRling syntax into a structured tree.
  2. Compile: AST -> IR (Intermediate Representation)
    • Transforms the AST into a target-agnostic intermediate representation, optimizing structures like literal sequences.
  3. Emit: IR -> Target Regex
    • Generates the final, optimized regex string for the specific target engine (e.g., PCRE2, JS, Python re).

📚 Documentation

🌐 Connect

GitHub

💖 Support

If you find STRling useful, consider starring the repository and contributing!