# fent/randexp.js

Create random strings that match a given regular expression.

Repository: https://github.com/fent/randexp.js
Canonical: https://ross.abutalabs.com/products/randexpjs
Homepage: http://fent.github.io/randexp.js/
Language: JavaScript
License: MIT
License Family: permissive
Topics: node, regular-expression, testing
Last push: 2025-11-23T05:49:16+00:00

## Health v2 (maintenance only)
Score: 47/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 53, release rhythm 8, longevity 100
- inputs: {"age_days": 5384, "days_push": 283, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1867, forks 94 (observed 2026-08-28T04:05:46.396110+00:00)

## What it is
A JavaScript library that generates random strings matching a given regular expression. It supports grouping, ranges, references, custom character ranges, and pluggable PRNGs, working in Node.js and browsers.

## Use cases
- generate random strings matching a regex
- create test data for form validation
- generate sample input for regex-based parsers
- seeded random string generation for reproducible tests
- generate mock usernames or identifiers from a pattern

## When to choose
- you need test fixtures or mock data shaped by a regex pattern
- you want a small, dependency-free Node or browser library for random string generation
- you need custom character ranges or a seedable PRNG

## When to avoid
- you need general-purpose fake data like names, addresses, or emails (use a faker library)
- your regexes use lookaheads or other constructs randexp cannot expand
- you need cryptographically secure output without supplying your own PRNG

## Facets
- artifact type: library
- maturity: stable
- function: data-generation, testing, parser
- domain: developer-tools, testing
- platform: browser
- tags: regex, random-string-generation, test-data, mock-data, automation, nodejs, javascript

## Member repositories
- fent/randexp.js (main) score 47

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:46.396110+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:15:23.223394+00:00, confidence not recorded.
  - readme: https://github.com/fent/randexp.js (fetched 2026-08-28T04:05:46.396110+00:00, sha 6e0ddd0ed829)
  - homepage: http://fent.github.io/randexp.js/ (fetched 2026-08-29T10:54:30.234172+00:00, sha 9b590ab435e5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
