0.0.2 • Published 4 years ago
@lukaspolak/kebab-case v0.0.2
kebab-case
Convert a string to kebab-case, i.e. its dash-separated form
Demo
Getting started
To use this package, you only need to install this dependency, import it and invoke the kebabCase
function, e.g.:
import { kebabCase } from '@lukaspolak/kebab-case'
kebabCase('Lorem ipsum dolor sit amet') // returns "lorem-ipsum-dolor-sit-amet"
Install
npm install @lukaspolak/kebab-case
or
yarn add @lukaspolak/kebab-case
Documentation
passed value | expected value |
---|---|
loremIpsumDolorSitAmet | lorem-ipsum-dolor-sit-amet |
LOREM_IPSUM_DOLOR_SIT_AMET | lorem-ipsum-dolor-sit-amet |
lorem.ipsum.dolor.sit.amet | lorem-ipsum-dolor-sit-amet |
lorem ipsum dolor sit amet | lorem-ipsum-dolor-sit-amet |
lorem-ipsum-dolor-sit-amet | lorem-ipsum-dolor-sit-amet |
LoremIpsumDolorSitAmet | lorem-ipsum-dolor-sit-amet |
lorem/ipsum/dolor/sit/amet | lorem-ipsum-dolor-sit-amet |
lorem_ipsum_dolor_sit_amet | lorem-ipsum-dolor-sit-amet |
Lorem Ipsum Dolor Sit Amet | lorem-ipsum-dolor-sit-amet |
LOREM IPSUM DOLOR SIT AMET | lorem-ipsum-dolor-sit-amet |
Lorem ipsum dolor sit amet | lorem-ipsum-dolor-sit-amet |
Lorem ipsum dolor sit amet.,/#!$%^&*;:{}=-_`~() | lorem-ipsum-dolor-sit-amet | |
Lorem ipsum #!$%^&*;(dolor sit amet)#!$%^&*;' | lorem-ipsum-dolor-sit-amet |
Contributing
Please read the Contribution guidelines to start with your awesome contributions!
Why the library is prefixed with @lukaspolak/
There are a lot of similar libraries/packages on GitHub and npm, that can do the same. I wanted to enhance my programming skills, and I didn't want to find a unique name for the package.