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

synth-project-name

v0.1.0

Published

Project name generation, validation, and uniqueness tracking.

Readme

synth-project-name

Zero-config project name generation, validation, and uniqueness tracking.

Generate adj-noun names from your own pools, validate against constraints, track uniqueness — all without hardcoded data.


Table of Contents


Install

npm install synth-project-name

Quick Start

import { uniqueFromPool, createMemoryStore } from "synth-project-name";

const store = createMemoryStore();
const name = await uniqueFromPool(store, {
  adjectives: ["fast", "cool", "bold"],
  nouns: ["api", "core", "node"],
});

// → "bold-core"

Modules

name.ts — Generate

Generate adj-noun names from caller-provided pools. Supports language-specific noun overrides.

import { generateName, generateShortName, sanitizeKebabName, randomSuffix } from "synth-project-name";

const pools = { adjectives: ["fast", "cool"], nouns: ["api", "core"] };

generateShortName(pools);
// → "fast-core"

generateName(
  { pools, langNouns: { TypeScript: ["vault", "prism"] }, fallbackLang: "TypeScript" },
  "TypeScript"
);
// → "cool-vault"

sanitizeKebabName("My Cool App!");
// → "my-cool-app"

randomSuffix(4);
// → "a3f1"

unique.ts — Uniqueness

Track used names via a pluggable NameStore interface. Built-in memory store for testing.

import { uniqueName, uniqueFromPool, createMemoryStore } from "synth-project-name";

const store = createMemoryStore();

await uniqueName(store, "my-app");
// → "my-app"

await uniqueName(store, "my-app");
// → "my-app-3a7f"

| Function | Description | |---|---| | uniqueName(store, candidate) | Returns candidate if unique, appends suffix otherwise | | uniqueFromPool(store, pools) | Random pick from pool, falls back to suffix on collision | | createMemoryStore() | In-memory store for tests |


filter.ts — Filtering

Composable pattern-based filters with negate, combine, and compound modes.

import { createCompoundFilter, negateFilter } from "synth-project-name";

const isSuspicious = createCompoundFilter({
  exclude: [/internal/i, /debug/i],
  minLength: 5,
  allowedChars: /^[a-z0-9-]+$/,
});

isSuspicious("my-app");     // → true
isSuspicious("internal-x"); // → false

const isClean = negateFilter(isSuspicious);

| Function | Logic | |---|---| | createPatternFilter(patterns) | any pattern matches | | createAllPatternFilter(patterns) | all patterns match | | createCompoundFilter(opts) | include → exclude → length → chars → custom | | negateFilter(filter) | Inverts result | | combineFilters(...filters) | AND logic |


validate.ts — Validation

Constraint-based validation with structured error reporting.

import { validateName, isValidName } from "synth-project-name";

isValidName("my-app", { minLength: 3, allowedChars: /^[a-z-]+$/ });
// → true

validateName("ab", { minLength: 3 });
// → { valid: false, errors: [{ rule: "minLength", message: "..." }] }

Supported constraints:

| Constraint | Type | Description | |---|---|---| | minLength | number | Minimum character count | | maxLength | number | Maximum character count | | pattern | RegExp | Must match | | allowedChars | RegExp | Every character must pass | | blockPatterns | RegExp[] | Must not match any | | requirePatterns | RegExp[] | Must match at least one | | prefix | string | Must start with | | suffix | string | Must end with | | allowedCases | string[] | kebab, snake, camel, pascal, upper, lower |


transform.ts — Transform

Case conversion, smart truncation, and prefix/suffix helpers.

import { normalizeName, truncateName, addAffix } from "synth-project-name";

normalizeName("My Cool App", { caseStyle: "camel" });
// → "myCoolApp"

truncateName("my-cool-app-name", 10, "smart");
// → "my-cool"

addAffix("core", { prefix: "my-", suffix: "-app" });
// → "my-core-app"

| Case Style | Input | Output | |---|---|---| | kebab | My Cool App | my-cool-app | | snake | My Cool App | my_cool_app | | camel | My Cool App | myCoolApp | | pascal | My Cool App | MyCoolApp | | lower | My Cool App | mycoolapp | | upper | My Cool App | MYCOOLAPP |


pool.ts — Sampling

Random sampling, weighted picks, and shuffling.

import { samplePool, weightedPickPool, shuffle } from "synth-project-name";

samplePool(["a", "b", "c"], 2);
// → ["c", "a"]

weightedPickPool([
  { item: "a", weight: 10 },
  { item: "b", weight: 1 },
]);
// → "a" (91% probability)

shuffle([1, 2, 3]);
// → [2, 3, 1] (random order)

| Function | Description | |---|---| | samplePool(pool, count) | Sample with replacement | | sampleUniquePool(pool, count) | Sample without replacement | | weightedPickPool(items) | Weighted single pick | | weightedSamplePool(items, count) | Weighted with replacement | | shuffle(arr) | Fisher-Yates shuffle | | pickRandom(pool) | Single random pick |


API Reference

All exports and type definitions are in src/index.ts. See source for full type signatures.


License

MIT © mra1k3r0