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 🙏

© 2024 – Pkg Stats / Ryan Hefner

change-case-all

v2.1.0

Published

All change-case methods bundled in a single module

Downloads

22,599,897

Readme

change-case-all

CI npm npm npm

Change case functions for all cases in TypeScript and JavaScript. Combined version of all change-case methods, so you do not need to install them separately. ESM and CJS bundles are included, also backwards compatible with [email protected].

[email protected] introduces a Case helper class, which can be used to access all methods.

Usage

npm install --save change-case-all

Browser / ESM

import { Case } from 'change-case-all';
const camel = Case.camel('test string'); // testString
const upper = Case.upper('test string'); // TEST STRING


import { camelCase, upperCase, ... } from 'change-case-all';
const camel = camelCase('test string'); // testString
const upper = upperCase('test string'); // TEST STRING

Node.js

const { Case } = require('change-case-all');
const camel = Case.camel('foo-bar'); // fooBar
const snake = Case.snake('fooBar'); // foo_bar

const { camelCase, snakeCase } = require('change-case-all');
const camel = camelCase('foo-bar'); // fooBar
const snake = snakeCase('fooBar'); // foo_bar

Changelog

2.1.0

  • Bundle dependencies in module to support Node.js

2.0.0

  • Updated dependencies to [email protected]
  • ParamCase → now KebabCase
  • HeaderCase → now TrainCase
  • Create mjs and cjs bundles
  • Introduce Case helper class: e.g. Case.camel('test string'); // testString
  • [email protected] failing in tests, thus kept at 3.0.3

Links

  • Original project: https://github.com/blakeembrey/change-case
  • Bundled browser friendly version: https://github.com/nitro404/change-case-bundled

Methods

Class based usage

import { Case } from 'change-case-all';

const str = 'test string';

camel       = Case.camel(str);               // testString
capital     = Case.capital(str);             // Test String
constant    = Case.constant(str);            // TEST_STRING
dot         = Case.dot(str);                 // test.string
no          = Case.no(str);                  // test string
pascal      = Case.pascal(str);              // TestString
path        = Case.path(str);                // test/string
sentence    = Case.sentence(str);            // Test string
snake       = Case.snake(str);               // test_string
train       = Case.train(str);               // Test-String
kebap       = Case.kebap(str);               // test-string
sponge      = Case.sponge(str);              // TeSt StRiNg
swapCase    = Case.swap(str);                // TEST STRING
title       = Case.title(str);               // Test String
uppper      = Case.upper(str);               // TEST STRING
localeUpper = Case.localeUpper(str, 'en');   // TEST STRING
lower       = Case.lower(str);               // test string
localeLower = Case.localeLower(str, 'en');   // test string
lowerFirst  = Case.lowerFirst(str);          // test string
upperFirst  = Case.upperFirst(str);          // Test string
isUpper     = Case.isUpper(str);             // false
isLower     = Case.isLower(str);             // true

Function based usage

import { camelCase, upperCase, ... } from 'change-case-all';

const str = 'test string';

camel       = camelCase(str);               // testString
capital     = capitalCase(str);             // Test String
constant    = constantCase(str);            // TEST_STRING
dot         = dotCase(str);                 // test.string
no          = noCase(str);                  // test string
pascal      = pascalCase(str);              // TestString
path        = pathCase(str);                // test/string
sentence    = sentenceCase(str);            // Test string
snake       = snakeCase(str);               // test_string
train       = trainCase(str);               // Test-String
kebap       = kebapCase(str);               // test-string
sponge      = spongeCase(str);              // TeSt StRiNg
swapCase    = swapCase(str);                // TEST STRING
title       = titleCase(str);               // Test String
uppper      = upperCase(str);               // TEST STRING
localeUpper = localeUpperCase(str, 'en');   // TEST STRING
lower       = lowerCase(str);               // test string
localeLower = localeLowerCase(str, 'en');   // test string
lowerFirst  = lowerCaseFirst(str);          // test string
upperFirst  = upperCaseFirst(str);          // Test string
isUpper     = isUpperCase(str);             // false
isLower     = isLowerCase(str);             // true