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

wildstar

v1.0.2

Published

minimal, path-aware, unicode-safe pattern matching with captures

Readme

💫 wildstar

A minimal, path-aware, platform-unaware, unicode-safe pattern matching library for node.js. Supports captures and replacements.

Features

  • Wildcard matching with * (zero or more characters) and *+ (one or more characters)
  • Wildcard matching across path segments with ** (zero or more segments) and **+ (one or more segments)
  • Each wildcard captures results
  • provides simple path methods like root, leaf, parent, join, and more, making it a minimal alternative to Node's path module for platform-unaware path manipulation.

Installation

npm install wildstar

Pattern Syntax

wildstar

  • * matches zero or more characters
  • *+ matches one or more characters

wildstar/path

  • * matches zero or more characters within a single path segment (does not cross path boundaries)
  • *+ matches one or more characters within a single path segment (does not cross path boundaries)
  • ** matches zero or more entire path segments (crosses path boundaries)
  • **+ matches one or more entire path segments (crosses path boundaries)

Usage

// modules
import ws from 'wildstar' // path-unaware matching functions
import iws from 'wildstar/insensitive' // same as above, case insensitive version

import path from 'wildstar/path' // path-aware matching functions and path utilities
import ipath from 'wildstar/path/insensitive' // same as above, case insensitive version

// Bool matching
ws.matches('hello world', 'h*o w*d') // true

// Captures
ws.match('foo bar', 'foo *') // ['bar']

// Replace
ws.replace('baz <1>', ['bar']) // 'baz bar'

// Remap (match + replace)
ws.remap('foo bar', 'foo *', 'baz <1>') // 'baz bar'

// Always greedy
ws.match('aaa', '*a') // ['aa']

// Path matching
path.match('foo/bar/baz.txt', 'foo/*/*.txt') // ['bar', 'baz']
path.match('foo/bar/baz.txt', 'foo/*') // null: * doesn't cross path boundaries
path.match('foo/bar/baz.txt', 'foo/**') // ['bar/baz.txt'] ** crosses path boundaries

// Path utility functions
path.normalize('foo//bar\\../baz/.\\') // 'foo/baz'
path.root('c:/foo/bar/baz.txt') // 'c:'
path.leaf('foo/bar/baz.txt')    // 'baz.txt'
path.parent('foo/bar/baz.txt')  // 'foo/bar'
path.join('foo', 'bar', 'baz')  // 'foo/bar/baz'
path.relative('foo/bar', 'foo/bar/baz') // 'baz'

// fun
const ext = path.match('foo/bar/baz.tar.gz', '**/*.*')?.[2] // tar.gz

Notes

  • Each *, **, *+ and **+ will fill a capture slot, even if empty
  • Wildstar does not consider trailing slashes
  • Subpath captures and path methods always return / as separator
  • Unlike glob, folder/** matches both folder and folder/anything
  • Unlike glob, **/folder matches both folder and anything/folder
  • Path handling is entirely platform unaware. Paths like c:/foo/bar and /foo/bar are always considered absolute
  • ** and **+ are only considered when a full path segment is exactly ** or **+
  • Matches are greedy: each wildcard will match as much as possible while still allowing the overall pattern to match

Why platform unaware

A platform-unaware path implementation treats all paths the same way, no matter the operating system. This makes it easy to use paths for other purposes other than file system usage.

API

See API docs for full documentation

License

MIT