Gathering detailed insights and metrics for case
Gathering detailed insights and metrics for case
Gathering detailed insights and metrics for case
Gathering detailed insights and metrics for case
no-case
Transform any case string into a lower case string with a space between each word
lower-case
Transforms the string to lower case
param-case
Transform into a lower cased string with dashes between words
camel-case
Transform into a string with the separator denoted by the next word capitalized
npm install case
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.7
Supply Chain
99.5
Quality
76
Maintenance
100
Vulnerability
93.6
License
JavaScript (93.4%)
CSS (5.83%)
HTML (0.77%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
283 Stars
147 Commits
23 Forks
4 Watchers
4 Branches
10 Contributors
Updated on Jun 16, 2025
Latest Version
1.6.3
Package Id
case@1.6.3
Size
8.94 kB
NPM Version
6.14.1
Node Version
10.15.3
Published on
Mar 24, 2020
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Download: Case.min.js or Case.js
NPM: npm install case
(little 'c' due to NPM restrictions)
NuGet: Install-Package Case
Each of the following functions will first "undo" previous case manipulations before applying the desired case to the given string.
1Case.upper('foo_bar') -> 'FOO BAR' 2Case.lower('fooBar') -> 'foo bar' 3Case.capital('foo_v_bar') -> 'Foo V Bar'
1Case.snake('Foo bar!') -> 'foo_bar' 2Case.pascal('foo.bar') -> 'FooBar' 3Case.camel('foo, bar') -> 'fooBar' 4Case.kebab('Foo? Bar.') -> 'foo-bar' 5Case.header('fooBar=') -> 'Foo-Bar' 6Case.constant('Foo-Bar') -> 'FOO_BAR'
1Case.title('foo v. bar') -> 'Foo v. Bar' 2Case.sentence('"foo!" said bar', ['Bar']) -> '"Foo!" said Bar' 3Case.sentence('the 12 oz. can', null, ['oz']) -> 'The 12 oz. can'
Case.sentence(str, names, abbreviations)
accepts an array of proper names that should be capitalized,
regardless of location in the sentence. This function is specialized, but useful
when dealing with input generated with capslock on (i.e. everything my grandma types).
It can also accept a list of abbreviations (words that may end in a period but aren't meant
to end a sentence).
1Case.lower('FOO-BAR', '.') -> 'foo.bar' 2Case.upper('Foo? Bar.', '__') -> 'FOO__BAR' 3Case.capital('fooBar', ' + ') -> 'Foo + Bar' 4 5Case.lower("Don't keep 'em!", "/", true) -> 'dont/keep/em' 6Case.capital("'ello, world.", null, true) -> 'Ello, World.'
Case.upper
, Case.lower
, and Case.capital
accept an optional "fill" value
that will replace any characters which are not letters and numbers. All three also accept
a third optional boolean argument indicating if apostrophes are to be stripped out or left in.
For example, programmatic case changes (snake, kebab, pascal, camel, constant) are best without
apostrophes, but user-facing ones (title, sentence) do not want "don't" turned into "Dont".
1Case.type('bang', function(s) { 2 return Case.upper(s, '!')+'!'; 3}); 4Case.bang('bang') -> 'BANG!' 5Case.of('TEST!THIS!') -> 'bang'
Case.type(name, fn)
: extends Case, creating a new function on Case
and adding Case.of
support automatically.
1Case.of('foo') -> 'lower' 2Case.of('foo_bar') -> 'snake' 3Case.of('Foo v Bar') -> 'title' 4Case.of('foo_ Bar') -> undefined 5 6Case.of('Hello there, Bob!', ['Bob']) -> 'sentence' 7 8Case.flip('FlipMe') -> 'fLIPmE' 9Case.flip('TEST THIS!') -> 'test this!' 10 11Case.random('Hello!') -> 'hElLO!'
Case.of(str[, names])
: identifies the case of a string, returns undefined if it doesn't match a known typeCase.flip(str)
: reverses the case of letters, no other changesCase.random(str)
: randomizes the case of letters, no other changesNo vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/8 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
40 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More