Gathering detailed insights and metrics for kebab-case
Gathering detailed insights and metrics for kebab-case
Gathering detailed insights and metrics for kebab-case
Gathering detailed insights and metrics for kebab-case
Convert a string to kebab-case, i.e. its dash separated form
npm install kebab-case
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
23 Stars
11 Commits
4 Forks
2 Watching
1 Branches
2 Contributors
Updated on 28 Jun 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-0.3%
49,981
Compared to previous day
Last week
3.7%
297,352
Compared to previous week
Last month
17.7%
1,153,188
Compared to previous month
Last year
28.3%
12,330,166
Compared to previous year
4
Convert a string to kebab-case, i.e. its dash separated form
The difference between kebab-case
and e.g. dashify
is that this
module doesn't modify the string in any other way than transforming uppercased letters to their lowercased
counterparts prefixed with -
. Thanks to this there's also a reverse
function to
do the opposite, i.e. get back the original value.
This is used in Unistyle to transform JavaScript CSS properties
to their CSS counterparts without losing a possible browser prefix, e.g: WebkitTransform -> -webkit-transform
.
Install kebab-case
using npm:
1npm install --save kebab-case
1import kebabCase from "kebab-case"; 2 3kebabCase("WebkitTransform"); 4// "-webkit-transform" 5kebabCase.reverse("-webkit-transform"); 6// "WebkitTransform" 7kebabCase("WebkitTransform", false); 8// "webkit-transform"
kebabCase(str)
Name | Type | Description |
---|---|---|
str | String | The string to convert |
keepLeadingDash | Boolean | Whether to keep the leading dash or not. Default is true . |
Returns: String
, the kebab cased string.
kebabCase.reverse(str)
Name | Type | Description |
---|---|---|
str | String | The string to convert back |
Returns: String
, the "unkebab cased" string.
MIT © Joakim Carlstein
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
Found 1/11 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
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
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
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