0.0.2 • Published 4 years ago

@lukaspolak/kebab-case v0.0.2

Weekly downloads
69
License
MIT
Repository
github
Last release
4 years ago

kebab-case

checks-status workflow/status codecov npm bundle size npm

Convert a string to kebab-case, i.e. its dash-separated form

Demo

CodeSandbox

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 valueexpected value
loremIpsumDolorSitAmetlorem-ipsum-dolor-sit-amet
LOREM_IPSUM_DOLOR_SIT_AMETlorem-ipsum-dolor-sit-amet
lorem.ipsum.dolor.sit.ametlorem-ipsum-dolor-sit-amet
lorem ipsum dolor sit ametlorem-ipsum-dolor-sit-amet
lorem-ipsum-dolor-sit-ametlorem-ipsum-dolor-sit-amet
LoremIpsumDolorSitAmetlorem-ipsum-dolor-sit-amet
lorem/ipsum/dolor/sit/ametlorem-ipsum-dolor-sit-amet
lorem_ipsum_dolor_sit_ametlorem-ipsum-dolor-sit-amet
Lorem Ipsum Dolor Sit Ametlorem-ipsum-dolor-sit-amet
LOREM IPSUM DOLOR SIT AMETlorem-ipsum-dolor-sit-amet
Lorem ipsum dolor sit ametlorem-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.