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

capstring

v1.0.0

Published

CaPiTaLiZe StRiNgS in 24+ ways!

Readme

capstring npm version npm downloads CI Open Source Love Semver License LinkedIn

capstring

CaPiTaLiZe StRiNgS in 29 ways!

A lightweight, zero-dependency library for text capitalization and transformation. Perfect for formatting strings for code, URLs, display, or fun!

Features

  • 29 transformation styles - More than any other library!
  • Zero dependencies - Lightweight and fast
  • ESM native - Modern JavaScript modules
  • 98% test coverage - Thoroughly tested

Installation

npm install capstring

Quick Start

import capstring from 'capstring';

capstring('hello world', 'title');     // 'Hello World'
capstring('hello world', 'camel');     // 'helloWorld'
capstring('hello world', 'kebab');     // 'hello-world'
capstring('hello world', 'constant');  // 'HELLO_WORLD'
capstring('hello world', 'leet');      // 'h3££0 w0r£d'
capstring('hello world', 'hashtag');   // '#HelloWorld'

All 29 Styles

Case Styles

| Style | Input | Output | |-------|-------|--------| | same | Hello World | Hello World | | none | Hello World | (empty) | | proper | Hello World | Hello World | | title | hello world | Hello World | | sentence | hello world | Hello world | | upper | hello world | HELLO WORLD | | lower | HELLO WORLD | hello world | | swap | Hello World | hELLO wORLD |

Code Styles

| Style | Input | Output | |-------|-------|--------| | camel | hello world | helloWorld | | pascal | hello world | HelloWorld | | snake | hello world | hello_world | | kebab | hello world | hello-world | | slug | hello world | hello-world | | constant | hello world | HELLO_WORLD | | python | hello world | HELLO_WORLD | | dot | hello world | hello.world | | path | hello world | hello/world | | train | hello world | Hello-World |

Fun Styles

| Style | Input | Output | |-------|-------|--------| | leet | hello world | h3££0 w0r£d | | reverse | hello world | dlrow olleh | | sponge | hello world | HeLlO WoRlD | | mock | hello world | hElLo wOrLd | | alternate | hello world | hElLo WoRlD | | crazy | hello world | (deterministic random) | | random | hello world | (random case) |

New Styles

| Style | Input | Output | |-------|-------|--------| | hashtag | hello world | #HelloWorld | | acronym | as soon as possible | ASAP | | rot13 | hello | uryyb | | flip | hello | ollǝɥ |

API

capstring(str, style)

Transform a string to the specified style.

import capstring from 'capstring';

capstring('hello world', 'title');  // 'Hello World'
capstring('hello world');           // 'hello world' (default: same)
capstring(123);                     // false (invalid input)

getStyles()

Get an array of all supported style names.

import { getStyles } from 'capstring';

getStyles();  // ['same', 'none', 'proper', 'title', ...]

isValidStyle(style)

Check if a style is supported.

import { isValidStyle } from 'capstring';

isValidStyle('kebab');    // true
isValidStyle('invalid');  // false

STYLES

Frozen array of all style names.

import { STYLES } from 'capstring';

STYLES.length;  // 29

REST API

Looking for an API? Check out cAPIta - a full REST API powered by capstring!

curl https://your-api.com/title/hello%20world
# {"input":"hello world","output":"Hello World","cap":"title"}

Development

npm install        # Install dependencies
npm test           # Run tests
npm run lint       # Run linter
npm run test:coverage  # Test with coverage

Contributing

Please read CONTRIBUTING.md for details on the code of conduct and the process for submitting pull requests.

Versioning

This project uses Semantic Versioning 2.0.

Requirements

  • Node.js 18+
  • ES modules (import/export)

License

MIT - Copyright 2016-2026 Brian Funk