camel-to-kebab
This is a JavaScript library implementing one function, camelToKebabCase.
It accepts a camelCase string as input and outputs a kebab-case equivalent. It also works for PascalCase inputs.
This library is very lightweight at 892 bytes minified and 467 bytes gzipped. It requires no external dependencies, and it's licensed according to the permissive
zlib/libpng license.
Installation
You can add camelToKebabCase to your JavaScript project by using a
package manager to install the camel-to-kebab
package. For example:
npm install --save camel-to-kebab
Usage
camelToKebabCase can be used in the browser, imported as a CommonJS
module, or imported as an ES module.
const camelToKebabCase = require("camel-to-kebab");
import camelToKebabCase from "camel-to-kebab";
<script src="camel-to-kebab.min.js"></script>
Examples
const camelToKebabCase = require("camel-to-kebab");
console.log(camelToKebabCase("helloWorld"));
console.log(camelToKebabCase("camelToKebabCase"));
console.log(camelToKebabCase("testing123"));
console.log(camelToKebabCase("innerHTML"));
console.log(camelToKebabCase("borderTopLeftRadius"));