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

stupex

v1.0.6

Published

A package to convert Stupex expressions to Regex and vice versa.

Readme

Table of Contents

Installation

Install the stupex package using npm:

npm install stupex

Summary

Stupex is a user-friendly, intuitive syntax for working with regular expressions, designed to make it easier for non-programmers and those with minimal technical skills to create, read, and understand regex patterns.

Why Stupex

  • Regular expressions can be quite powerful, but their syntax is often considered cryptic and hard to grasp, especially for beginners. The purpose of the Stupex package is to provide a more accessible alternative to regex, using a simplified and descriptive syntax.

  • Stupex expressions can be easily translated to regular expressions and vice versa using the provided functions, making it simple to integrate Stupex into your existing projects or learn regex patterns from their Stupex counterparts.

  • By using Stupex, you can harness the power of regular expressions without getting lost in their complex syntax.

Features

  • Intuitive, human-readable syntax for defining regular expressions

  • Bi-directional conversion between Stupex and regex expressions

  • Compatibility with existing JavaScript regex patterns

Usage

The Stupex package provides two main functions for converting between Stupex and regex expressions:

NorEx-to-RegEx

stupexToRegex() Converts a Stupex expression to a regex pattern.

RegEx-to-NorEx

regexToStupex() Converts a regex pattern to a Stupex expression.

These functions can be used to seamlessly integrate Stupex into your existing codebase and simplify the process of working with regular expressions.

Available Expressions

For a complete list of available Stupex expressions and their corresponding regex patterns, please refer to the Stupex Expressions Table.

Examples

Search for http:// or https://:

# Stupex

// Syntax #1

line-start:
  "http"
  optional "s"
  "://"


// Syntax #2

line-start:
  "http"
  optional("s")
  "://"


// Syntax #3

line-start("http" optional("s") "://")
# Regex

^http(?:s)?://

Search for hello world:

# Stupex

// Syntax #1

"hello"
any:
  whitespace
  non-whitespace
"world"


// Syntax #2

"hello"
any whitespace non-whitespace
"world"


// Syntax #3
"hello" any(whitespace non-whitespace) "world"
# Regex

hello[\s\S]*?world

Table of Expressions

| Regex Expression | Stupex Expression | Description | | ---------------------------------------------------- | --------------------------------------- | --------------------------------------------------- | | . | (char) | Any character | | ^exp | starts-with(exp) | Starts with expression | | exp$ | ends-with(exp) | Ends with expression | | ^exp$ | is-within(exp) | Is within expression | | exp* | optional(exp) | Zero or more repetitions | | exp+ | at-least-once(exp) | One or more repetitions | | exp? | once-at-most(exp) | Zero or one repetition | | {n} | repeat-n-times(exp) | Repeat n times | | {n,} | repeat-n-or-more(exp) | Repeat n or more times | | {n,m} | repeat-n-to-m(exp) | Repeat n to m times | | [chars] | with(chars) | Any character in set | | [^chars] | without(chars) | Any character not in set | | exp\|alt | either-or(exp, alt) | Either expression or alternative | | \(exp\) | group(exp) | Group expression | | \\ | escape-symbol | Escape symbol | | \d | (digit) | Digit character | | \D | (non-digit) | Non-digit character | | \w | (word-char) | Word character | | \W | (non-word-char) | Non-word character | | \s | (whitespace) | Whitespace character | | \S | (non-whitespace) | Non-whitespace character | | \bexp | word(exp) | Word boundary expression | | \Bexp | non-word(exp) | Non-word boundary expression | | (?=exp) | will-occur(exp) | Positive lookahead | | (?!exp) | will-not-occur(exp) | Negative lookahead | | (?<=exp) | has-occurred(exp) | Positive lookbehind | | (?<!exp) | has-not-occurred(exp) | Negative lookbehind | | (?:exp) | non-capture-group(exp) | Non-capturing group | | (?=exp-1)(?=exp-2)...(?=exp-n) | all-of(exp-1, ..., exp-n) | All expressions occur | | exp-1\|exp-2\|...\|exp-n | one-of(exp-1, ..., exp-n) | One of the expressions occurs | | (?=exp-1) (?=exp-2) (?!(?=exp-1) (?=exp-2) | some-of(exp-1, ..., exp-n) | Some of the expressions occur | | exp-1(?=.*exp-2)(?=.*exp-3)... | all-of-by-this-order(exp-1, ..., exp-n) | All expressions occur in order | | Custom implementation | js-symbol(exp) | Any JS symbol with name returned from expression | | Custom implementation | js-class(exp) | Any JS class with name returned from expression | | Custom implementation | js-function(exp) | Any JS function with name returned from expression | | Custom implementation | js-interface(exp) | Any JS interface with name returned from expression | | Custom implementation | js-arg(exp) | Any JS argument with a name described as expression |

  • Additional expressions available, see package documentation for details.

Contributing

We welcome contributions to improve and expand the Stupex package. If you have ideas for new expressions or improvements to the syntax, please feel free to submit a pull request or open an issue on the project's GitHub repository.