https://github.com/kamicane/camelize
camel case & hyphenation
https://github.com/kamicane/camelize
Last synced: 5 months ago
JSON representation
camel case & hyphenation
- Host: GitHub
- URL: https://github.com/kamicane/camelize
- Owner: kamicane
- Created: 2019-12-31T03:24:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-31T03:32:09.000Z (over 6 years ago)
- Last Synced: 2025-10-12T03:15:01.564Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# camelize
stupid simple camelize implementation, dates back to the mootools era
```js
const { camelize, hyphenate } = require('@kamicane/camelize')
```
```js
const camelize = require('@kamicane/camelize/camelize')
const hyphenate = require('@kamicane/camelize/hypenate')
```
```js
camelize("the-quick-brown-fox")
// 'theQuickBrownFox'
camelize("the-quick-brown--fox.jumps---over..the-lazy_dog")
// 'theQuickBrownFoxJumpsOverTheLazyDog'
camelize("-the-quick")
// 'TheQuick'
```
```js
> hyphenate('theQuickBrownFox')
// 'the-quick-brown-fox'
> hyphenate('TheQuickBrownFox')
// '-the-quick-brown-fox'
> hyphenate('theQuickBrownFox', '.')
// 'the.quick.brown.fox'
```