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

case-kit

v0.1.0

Published

A collection of functions to convert strings between various cases

Readme

case-kit

A collection of functions to convert strings between various cases.

Installation

npm install case-kit

Usage

import { camelCase, kebabCase } from "case-kit";
// or
const { camelCase, kebabCase } = require("case-kit");

general

capitalize(str: string): string

Capitalizes the first character of a string, and leaves the rest unchanged.

import { capitalize } from "case-kit";

capitalize("foo-bar"); // => 'Foo-bar'

words(str: string, asciiOnly = false): string[]

Splits a string into words, just like words in lodash.

asciiOnly is a boolean flag that determines whether to split the string using only ASCII characters.

import { words } from "case-kit";

words("  foo&bar_baz-qux  "); // => ['foo', 'bar', 'baz', 'qux']
words("FooBarBAZ123"); // => ['Foo', 'Bar', 'BAZ', '123']
words("🚀Lunedì नमस्ते"); // => ['🚀', 'Lunedì', 'नमस्ते']
words("1st 2nd+3rd--4th@1ST*2ND-3RD_4TH"); // => ['1st', '2nd', '3rd', '4th', '1ST', '2ND', '3RD', '4TH']
words("I don't+can't-won't"); // => ['I', "don't", "can't", "won't"]

All the following case functions take the same two optional arguments: str and asciiOnly. The str argument is the string to convert, and the asciiOnly argument is a boolean flag that determines whether to convert the string using only ASCII characters.

camel

camelCase (dromedaryCase)

import { camelCase } from "case-kit";

camelCase("foo-bar"); // => 'fooBar'

camelSnakeCase

import { camelSnakeCase } from "case-kit";

camelSnakeCase("foo-bar"); // => 'foo_Bar'

upper

cobolCase (screamingKebabCase)

import { cobolCase } from "case-kit";

cobolCase("foo-bar"); // => 'FOO-BAR'

screamingSnakeCase (macroCase, constantCase, upperSnakeCase)

import { screamingSnakeCase } from "case-kit";

screamingSnakeCase("foo-bar"); // => 'FOO_BAR'

upperFlatCase

import { upperFlatCase } from "case-kit";

upperFlatCase("foo-bar"); // => 'FOOBAR'

upperCase

import { upperCase } from "case-kit";

upperCase("foo-bar"); // => 'FOO BAR'

lower

flatCase

import { flatCase } from "case-kit";

flatCase("foo-bar"); // => 'foobar'

kebabCase

import { kebabCase } from "case-kit";

kebabCase("fooBar"); // => 'foo-bar'

snakeCase (potholeCase)

import { snakeCase } from "case-kit";

snakeCase("fooBar"); // => 'foo_bar'

lowerCase

import { lowerCase } from "case-kit";

lowerCase("fooBar"); // => 'foo bar'

dotCase

import { dotCase } from "case-kit";

dotCase("foo-bar"); // => 'foo.bar'

pathCase

import { pathCase } from "case-kit";

pathCase("foo-bar"); // => 'foo/bar'

pipeCase

import { pipeCase } from "case-kit";

pipeCase("foo-bar"); // => 'foo|bar'

capital

pascalCase (upperCamelCase)

import { pascalCase } from "case-kit";

pascalCase("foo-bar"); // => 'FooBar'

pascalSnakeCase (adaCase)

import { pascalSnakeCase } from "case-kit";

pascalSnakeCase("foo-bar"); // => 'Foo_Bar'

titleCase (startCase)

import { titleCase } from "case-kit";

titleCase("foo-bar"); // => 'Foo Bar'

headerCase (trainCase)

import { headerCase } from "case-kit";

headerCase("foo-bar"); // => 'Foo-Bar'

other

sentenceCase

import { sentenceCase } from "case-kit";

sentenceCase("foo-bar"); // => 'Foo bar'

alternatingCase (studlyCaps)

import { alternatingCase } from "case-kit";

alternatingCase("foo-bar"); // => 'fOo bAr'

License

MIT