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

simple-title-case

v1.1.0

Published

A simple utility to convert strings to Title Case

Readme

🎉 simple-title-case

A smart utility to convert strings to Title Case — now with advanced rules for small words, punctuation, and CLI support. Lightweight, dependency-free, and ready for Node.js, browsers, or terminal use.


📦 What It Does

simple-title-case converts plain text into Title Case, with thoughtful support for:

✅ Small words (e.g. and, of, the) ✅ Apostrophes and hyphenated words ✅ Unicode characters (e.g. accented letters) ✅ CLI integration for terminal use ✅ Extra whitespace normalization ✅ Works in Node.js, React, or via shell commands


📁 Table of Contents


🚀 Installation

📦 For Node.js / React / TypeScript

Install as a dependency:

npm install simple-title-case

🖥️ For Global CLI Usage

Install globally to use the titlecase command in your terminal:

npm install -g simple-title-case

🔧 Usage

✅ In Node.js

const titleCase = require('simple-title-case');

console.log(titleCase("john's big-day at the park"));
// ➜ "John's Big-Day at the Park"

✅ In React / Frontend

import titleCase from 'simple-title-case';

function App() {
  const input = "a tale of two cities";
  return <h1>{titleCase(input)}</h1>; 
  // Renders: "A Tale of Two Cities"
}

export default App;

🖥️ CLI Usage

📌 After installing globally:

titlecase "the quick brown fox"
# ➜ The Quick Brown Fox

📌 Pipe input into it:

echo "john's big-day at the park" | titlecase
# ➜ John's Big-Day at the Park

🧪 Advanced Examples

| Input | Output | | ------------------------------ | ------------------------------ | | "the quick brown fox" | "The Quick Brown Fox" | | "a tale of two cities" | "A Tale of Two Cities" | | "john's big-day at the park" | "John's Big-Day at the Park" | | "ÉLÉGANCE and simplicity" | "Élégance and Simplicity" | | " extra spaces " | "Extra Spaces" | | "" (empty string) | "" |


💡 Why Use This?

  • No dependencies – Lightweight and fast
  • Smart casing – Skips small words unless first/last
  • Handles punctuation – Apostrophes and hyphens handled correctly
  • Unicode support – Handles accented characters properly
  • Use anywhere – Works in Node.js, frontend, CLI

⚙️ How It Works

Small Words (Excluded from Capitalization)

Small linking words are lowercased unless they are the first or last word:

a, an, and, as, at, but, by, for, in, nor, of, on, or, the, to, up, yet

🔧 For Local Development

If you're developing the CLI locally:

npm link

Then you can run it like:

titlecase "linked local usage works!"
# ➜ Linked Local Usage Works!

👨‍💻 Contribution

Found a bug or want to contribute? Pull requests and issues are welcome!

Steps:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feat/your-feature)
  3. Commit with Conventional Commits
  4. Open a Pull Request

📁 GitHub Repository

https://github.com/sonumehtaskr/simple-title-case


🪪 License

MIT © Sonu Kumar