https://github.com/dc0d/caseconv
snake, kebab, camel, pascal case conversion
https://github.com/dc0d/caseconv
camel-case golang kebab-case pascal-case snake-case string-casing
Last synced: 8 months ago
JSON representation
snake, kebab, camel, pascal case conversion
- Host: GitHub
- URL: https://github.com/dc0d/caseconv
- Owner: dc0d
- License: mit
- Created: 2018-02-23T12:18:14.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-13T21:09:59.000Z (over 4 years ago)
- Last Synced: 2025-04-12T12:53:44.933Z (10 months ago)
- Topics: camel-case, golang, kebab-case, pascal-case, snake-case, string-casing
- Language: Go
- Size: 34.2 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/dc0d/caseconv) [](https://goreportcard.com/report/github.com/dc0d/caseconv) [](https://codeclimate.com/github/dc0d/caseconv/maintainability) [](https://codeclimate.com/github/dc0d/caseconv/test_coverage)
# caseconv
This is a Go Module for snake, kebab, camel, pascal case conversion.
It can be used like:
```go
package main
import (
"fmt"
"github.com/dc0d/caseconv"
)
func main() {
input := "The quick brown fox jumps over the lazy dog"
fmt.Println(caseconv.ToCamel(input))
fmt.Println(caseconv.ToPascal(input))
fmt.Println(caseconv.ToKebab(input))
fmt.Println(caseconv.ToSnake(input))
}
```
And the output would be:
```
theQuickBrownFoxJumpsOverTheLazyDog
TheQuickBrownFoxJumpsOverTheLazyDog
the-quick-brown-fox-jumps-over-the-lazy-dog
the_quick_brown_fox_jumps_over_the_lazy_dog
```
> Most of test cases are from [change-case](https://github.com/blakeembrey/change-case) node package - so far. But the goal was not to follow same conventions.