Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janos/casbab
CLI tool and a Go library for Camel/Snake/Kebab case conversion
https://github.com/janos/casbab
Last synced: about 1 month ago
JSON representation
CLI tool and a Go library for Camel/Snake/Kebab case conversion
- Host: GitHub
- URL: https://github.com/janos/casbab
- Owner: janos
- License: bsd-3-clause
- Created: 2016-12-11T12:20:37.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-01-07T23:17:08.000Z (10 months ago)
- Last Synced: 2024-06-19T23:14:21.878Z (5 months ago)
- Language: Go
- Homepage:
- Size: 21.5 KB
- Stars: 5
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Camel Snake Kebab
CLI tool and a Go library for converting representation style of compound words or phrases.
[![GoDoc](https://godoc.org/resenje.org/casbab?status.svg)](https://godoc.org/resenje.org/casbab)
## Installation
```sh
go get resenje.org/casbab/cmd/casbab
``````sh
docker pull janos/casbab
```## Example usage
```sh
casbab screaming-snake "Camel Snake Kebab"
env | cut -d= -f1 | casbab kebab
``````sh
docker run --rm janos/casbab screaming-snake "Camel Snake Kebab"
env | cut -d= -f1 | docker run --rm -i janos/casbab kebab
```## Performance
Benchmarks run on MacBook Pro M1Pro yield these timings:
```
goos: darwin
goarch: arm64
pkg: resenje.org/casbab
BenchmarkCamel
BenchmarkCamel-10 3493452 336.7 ns/op 208 B/op 2 allocs/op
BenchmarkPascal
BenchmarkPascal-10 3532380 340.4 ns/op 208 B/op 2 allocs/op
BenchmarkSnake
BenchmarkSnake-10 3257454 366.4 ns/op 288 B/op 3 allocs/op
BenchmarkCamelSnake
BenchmarkCamelSnake-10 3164365 378.6 ns/op 288 B/op 3 allocs/op
BenchmarkScreamingSnake
BenchmarkScreamingSnake-10 2887975 415.8 ns/op 288 B/op 3 allocs/op
BenchmarkKebab
BenchmarkKebab-10 3232392 371.3 ns/op 288 B/op 3 allocs/op
BenchmarkCamelKebab
BenchmarkCamelKebab-10 3160936 382.2 ns/op 288 B/op 3 allocs/op
BenchmarkScreamingKebab
BenchmarkScreamingKebab-10 2873886 420.2 ns/op 288 B/op 3 allocs/op
BenchmarkLower
BenchmarkLower-10 3300728 369.9 ns/op 288 B/op 3 allocs/op
BenchmarkTitle
BenchmarkTitle-10 3079971 380.6 ns/op 288 B/op 3 allocs/op
BenchmarkScreaming
BenchmarkScreaming-10 2898652 417.5 ns/op 288 B/op 3 allocs/op
PASS
```