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

nomus

v1.0.4

Published

Convert text between naming conventions in Node.js and NestJS.

Downloads

485

Readme


Nomus is a naming-style toolkit for Node.js and NestJS. It detects the current style of a string and converts it to formats like UPPERCCASE, lowercase, PascalCase, camelCase, snake_case, SCREAMING_SNAKE_CASE, kebab-case, UPPER-KEBAB-CASE, Title Case and Train-Case.

🚀 Features

✔ Convert from any format to:

  • UPPERCCASE
  • lowercase
  • PascalCase
  • camelCase
  • snake_case
  • SCREAMING_SNAKE_CASE
  • kebab-case
  • UPPER-KEBAB-CASE
  • Title Case
  • Train-Case

Automatically detects:

  • UPPERCCASE
  • lowercase
  • PascalCase
  • camelCase
  • snake_case
  • SCREAMING_SNAKE_CASE
  • kebab-case
  • UPPER-KEBAB-CASE
  • Title Case
  • Train-Case
  • and mixed cases

✔ Pure TypeScript API for Node.js and TypeScript projects
✔ Optional NestJS integration exposed as nomus/nest
✔ ESM, CommonJS, and declaration files ready for npm publishing
✔ Detects common naming conventions and mixed input
✔ No runtime dependencies for the core package


📥 Installation

npm install nomus

For NestJS integration:

npm install nomus @nestjs/common reflect-metadata

Nomus is compatible with NestJS 10 projects that already use [email protected], and also with [email protected]. The nomus/nest entrypoint is also published in a way that works with classic TypeScript moduleResolution: node.

✨ Node.js Usage

import { Naming, detectNamingStyle, toSnakeCase } from "nomus";

detectNamingStyle("votesUsers");
// "camelCase"

toSnakeCase("UserVotesDetails");
// "user_votes_details"

Naming.toTrainCase("helloWorldTest");
// "Hello-World-Test"

✨ NestJS Usage

import { Module } from "@nestjs/common";
import { NomusModule } from "nomus/nest";

@Module({
  imports: [NomusModule]
})
export class AppModule {}
import { Injectable } from "@nestjs/common";
import { NomusService } from "nomus/nest";

@Injectable()
export class SlugService {
  constructor(private readonly nomus: NomusService) {}

  formatLabel(value: string) {
    return this.nomus.toKebabCase(value);
  }
}

🧩 Available Methods


🔤 Naming.*

Static equivalents for all methods

Naming.detectNamingStyle("UserVotesDetails");    // PascalCase
Naming.toTrainCase("userVotesDetails");          // "User-Votes-Details"

🔍 detectNamingStyle(input)

Automatically detects the naming convention of the text.

Possible results:

  • 'UPPERCASE'
  • 'lowercase'
  • 'PascalCase'
  • 'camelCase'
  • 'snake_case'
  • 'SCREAMING_SNAKE_CASE'
  • 'kebab-case'
  • 'UPPER-KEBAB-CASE'
  • 'Title Case'
  • 'Train-Case'
  • 'Unknown / Mixed'

Examples:

Naming.detectNamingStyle("UserVotesDetails");    // PascalCase
detectNamingStyle("userVotesDetails");           // camelCase
Naming.detectNamingStyle("user_votes_details");  // snake_case
detectNamingStyle("user-votes-details");         // kebab-case
Naming.detectNamingStyle("votes UsersDetails");  // Unknown / Mixed

🔠 toUpperCase(input)

Converts from any format to UPPERCASE.


🔡 toLowerCase(input)

Converts from any format to lowercase.


🧱 toPascalCase(input)

Converts from any format to PascalCase.


🐪 toCamelCase(input)

Converts from any format to camelCase.


🐍 toSnakeCase(input)

Converts from any format to snake_case.


🐍🔠 toScreamingSnakeCase(input)

Converts from any format to SCREAMING_SNAKE_CASE.


🔗 toKebabCase(input)

Converts from any format to kebab-case.


🔗🔠 toUpperKebabCase(input)

Converts from any format to UPPER-KEBAB-CASE.


🔤 toTitleCase(input)

Converts from any format to Title Case.


🚂 toTrainCase(input)

Converts from any format to Title Case.


🧪 Additional Examples

Naming.toPascalCase("hello-world");       // HelloWorld
toCamelCase("HELLO_WORLD");               // helloWorld
Naming.toSnakeCase("HelloWorld");         // hello_world
toKebabCase("helloWorldTest");            // hello-world-test
Naming.ToTrainCase("helloWorldTest");     // Hello-World-Test

detectNamingStyle("MyVariable");          // PascalCase
Naming.detectNamingStyle("myVariable");   // camelCase
detectNamingStyle("my_variable");         // snake_case
Naming.detectNamingStyle("my-variable");  // kebab-case
detectNamingStyle("My Variable");         // Title Case

📄 License

This project is licensed under the MIT License, which means you can freely use it in commercial and personal projects.


🤝 Contributing

Contributions are welcome! You can:

  • Report issues
  • Propose improvements
  • Submit PRs

⭐ Support the Project

If this package was useful to you, consider leaving a ⭐ on GitHub or sharing it with other developers.