Gathering detailed insights and metrics for fast-case
Gathering detailed insights and metrics for fast-case
Gathering detailed insights and metrics for fast-case
Gathering detailed insights and metrics for fast-case
micro-memoize
A tiny, crazy fast memoization library for the 95% use-case
fast-case-change-proxy
A package to access fields with a different case style without an extra build cost
fast-replaceall
Supports global replacement, case-insensitive mode, start index control, and functional replacement compatible with native `String.replace`.
case-alchemy
A light-weight, fast, tree-shakable library for effortless text case transformations with a touch of magic.
⚡Fast camelCase and PascalCase string and key conversion for JavaScript (Node / browser)
npm install fast-case
Typescript
Module System
Node Version
NPM Version
JavaScript (82.17%)
TypeScript (17.83%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
19 Stars
276 Commits
1 Forks
3 Watchers
5 Branches
3 Contributors
Updated on Apr 01, 2025
Latest Version
1.7.0
Package Id
fast-case@1.7.0
Unpacked Size
49.69 kB
Size
8.25 kB
File Count
10
NPM Version
8.1.2
Node Version
16.13.2
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
7
fast-case
is a JavaScript library for camelcase and pascalcase. It is designed to be similar to humps and xcase, with algorithm optimizations for additional speed.
1$ yarn add fast-case
1import { 2 camelize, 3 decamelize, 4 pascalize, 5 depascalize, 6 camelizeKeys, 7 camelizeKeysInPlace, 8 decamelizeKeys, 9 decamelizeKeysInPlace, 10 pascalizeKeys, 11 pascalizeKeysInPlace, 12 depascalizeKeys, 13 depascalizeKeysInPlace, 14} from 'fast-case' 15 16// 'a_string' -> 'aString' 17camelize(string) 18 19// 'aString' -> 'a_string' 20decamelize(string) 21 22// Optional custom separator 23// 'aString' -> 'a-string' 24decamelize(string, '-') 25 26// 'a_string' -> 'AString' 27pascalize(string) 28 29// 'AString' -> 'a_string' 30depascalize(string) 31 32// Optional custom separator 33// 'AString' -> 'a-string' 34depascalize(string, '-') 35 36// Camelize all object keys (recursive), 37// optionally modify the object in-place. 38camelizeKeys(obj) 39camelizeKeysInPlace(obj) 40 41// De-camelize all object keys (recursive), 42// optionally modify the object in-place. 43decamelizeKeys(obj) 44decamelizeKeysInPlace(obj) 45 46// Pascalize all object keys (recursive), 47// optionally modify the object in-place. 48pascalizeKeys(obj) 49pascalizeKeysInPlace(obj) 50 51// De-pascalize all object keys (recursive), 52// optionally modify the object in-place. 53depascalizeKeys(obj) 54depascalizeKeysInPlace(obj) 55 56// Optional custom separator for decamelizeKeys, 57// depascalizeKeys, and in-place variants. 58decamelizeKeys(obj, '-') 59decamelizeKeysInPlace(obj, '-') 60depascalizeKeys(obj, '-') 61depascalizeKeysInPlace(obj, '-')
Run yarn benchmark
to benchmark locally. Informal benchmark results are available via GitHub Actions.
xcase#camelize x 6,600,243 ops/sec ±0.72% (191 runs sampled)
fastCase#camelize x 7,716,825 ops/sec ±0.78% (190 runs sampled)
humps#camelize x 1,150,491 ops/sec ±0.54% (191 runs sampled)
Fastest is fastCase#camelize
xcase#decamelize x 6,095,752 ops/sec ±0.63% (192 runs sampled)
fastCase#decamelize x 6,251,767 ops/sec ±0.73% (192 runs sampled)
humps#decamelize x 2,087,936 ops/sec ±0.94% (189 runs sampled)
Fastest is fastCase#decamelize
xcase#pascalize x 6,623,570 ops/sec ±0.77% (188 runs sampled)
fastCase#pascalize x 7,438,234 ops/sec ±0.74% (188 runs sampled)
humps#pascalize x 1,060,071 ops/sec ±0.66% (192 runs sampled)
Fastest is fastCase#pascalize
xcase#depascalize x 6,207,477 ops/sec ±0.57% (191 runs sampled)
fastCase#depascalize x 6,130,597 ops/sec ±0.73% (186 runs sampled)
humps#depascalize x 1,909,126 ops/sec ±0.93% (190 runs sampled)
Fastest is xcase#depascalize
xcase#camelizeKeys x 749,311 ops/sec ±0.68% (190 runs sampled)
fastCase#camelizeKeys x 794,874 ops/sec ±0.72% (191 runs sampled)
humps#camelizeKeys x 224,859 ops/sec ±0.52% (191 runs sampled)
Fastest is fastCase#camelizeKeys
xcase#camelizeKeys (in place) x 835,931 ops/sec ±0.75% (190 runs sampled)
fastCase#camelizeKeysInPlace (in place) x 844,663 ops/sec ±0.88% (191 runs sampled)
Fastest is fastCase#camelizeKeysInPlace (in place)
xcase#decamelizeKeys x 812,360 ops/sec ±0.86% (191 runs sampled)
fastCase#decamelizeKeys x 786,222 ops/sec ±0.69% (189 runs sampled)
humps#decamelizeKeys x 378,324 ops/sec ±0.70% (192 runs sampled)
Fastest is xcase#decamelizeKeys
xcase#camelizeKeys (large object) x 822 ops/sec ±0.77% (187 runs sampled)
fastCase#camelizeKeys (large object) x 962 ops/sec ±1.16% (185 runs sampled)
humps#camelizeKeys (large object) x 282 ops/sec ±0.79% (185 runs sampled)
Fastest is fastCase#camelizeKeys (large object)
xcase#camelizeKeys (in place) (large object) x 688 ops/sec ±1.28% (181 runs sampled)
fastCase#camelizeKeysInPlace (in place) (large object) x 1,011 ops/sec ±0.59% (189 runs sampled)
Fastest is fastCase#camelizeKeysInPlace (in place) (large object)
xcase#pascalizeKeys (large object) x 589 ops/sec ±0.60% (183 runs sampled)
fastCase#pascalizeKeys (large object) x 680 ops/sec ±0.97% (186 runs sampled)
humps#pascalizeKeys (large object) x 338 ops/sec ±0.72% (181 runs sampled)
Fastest is fastCase#pascalizeKeys (large object)
xcase#pascalizeKeys (in place) (large object) x 1,007 ops/sec ±0.79% (183 runs sampled)
fastCase#pascalizeKeysInPlace (in place) (large object) x 1,356 ops/sec ±0.75% (188 runs sampled)
Fastest is fastCase#pascalizeKeysInPlace (in place) (large object)
This module is based in part on an older C++ based version of xcase
.
MIT license, see LICENSE
. Copyright 2018 Jacob Gillespie. Code originally from xcase, copyright 2016 Code Charm.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
all changesets reviewed
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
Project has not signed or included provenance with any releases.
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
16 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