Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevinmgranger/caser
Change text between PascalCase, camelCase, and snake_case.
https://github.com/kevinmgranger/caser
Last synced: 12 days ago
JSON representation
Change text between PascalCase, camelCase, and snake_case.
- Host: GitHub
- URL: https://github.com/kevinmgranger/caser
- Owner: KevinMGranger
- Created: 2021-03-31T21:16:06.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-21T17:31:26.000Z (over 3 years ago)
- Last Synced: 2024-11-28T14:49:25.576Z (28 days ago)
- Language: Rust
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# caser
Change text between PascalCase, camelCase, and snake_case.
Can be used as a library or a command-line program.
## CLI Usage
Usage: `caser CASE term [terms]`
Where `CASE` is one of pascal, camel, snake, or sentence.
For reference:
ThisIsPascalCase
thisIsCamelCase
this_is_snake_case
This is sentence case. It starts with a capital after each sentence-ending punctuation mark.Terms are converted and printed one per line.
Example: `caser snake ConvertToSnakeCase` would print `convert_to_snake_case`.
## Library Usage
To use as a library, use one of the `Case` variants to convert a `&str`.
`assert_eq!(caser::Case::SnakeCase.transform("PascalToSnake"), "pascal_to_snake")`
## Intent & See Also
This program is meant to be a simple get-the-job done utility.
If you need something more substantial, you might consider [change-case](https://crates.io/crates/change-case) or, heck, [heck](https://crates.io/crates/heck).