Crates.io | casbab |
lib.rs | casbab |
version | 0.1.1 |
source | src |
created_at | 2024-01-06 18:12:51.624349 |
updated_at | 2024-01-09 22:36:08.58555 |
description | A Rust client library for converting representation style of compound words or phrases. |
homepage | |
repository | https://github.com/janos/casbab-rs |
max_upload_size | |
id | 1091113 |
size | 51,609 |
Package casbab is a rust library for converting representation style of compound words or phrases. Different writing styles of compound words are used for different purposes in computer code and variables to easily distinguish type, properties or meaning.
Functions in this package are separating words from input string and constructing an appropriate phrase representation.
Run the following Cargo command in your project directory:
cargo add casbab
This library implements the following functions that return appropriate styles of compound words:
camelSnakeKebab
CamelSnakeKebab
camel_snake_kebab
Camel_Snake_Kebab
CAMEL_SNAKE_KEBAB
camel-snake-kebab
Camel-Snake-Kebab
CAMEL-SNAKE-KEBAB
camel snake kebab
Camel Snake Kebab
CAMEL SNAKE KEBAB
Benchmarks run cargo bench
on MacBook Pro M1Pro yield these timings:
camel time: [878.76 ns 884.24 ns 889.59 ns]
pascal time: [858.82 ns 866.89 ns 874.65 ns]
snake time: [537.22 ns 540.21 ns 543.24 ns]
camel_snake time: [870.81 ns 876.18 ns 881.71 ns]
screaming_snake time: [551.08 ns 552.52 ns 553.97 ns]
kebab time: [537.33 ns 540.59 ns 543.96 ns]
camel_kebab time: [863.78 ns 871.67 ns 879.36 ns]
screaming_kebab time: [554.04 ns 555.31 ns 556.61 ns]
lower time: [530.32 ns 531.99 ns 533.61 ns]
title time: [877.86 ns 884.77 ns 891.13 ns]
screaming time: [560.80 ns 563.78 ns 566.98 ns]
Build:
cargo install casbab --features build-binary
Get help:
casbab -h
Examples:
casbab screaming-snake "it is what it is"
casbab kebab my_snake_string some_kinda_Snake
echo "DO NOT SCREAM PLEASE" | casbab lower
cat variables.txt | casbab camel
Each version of the client is tagged and the version is updated accordingly.
To see the list of past versions, run git tag
.
We love pull requests! Please see the contribution guidelines.
This library is distributed under the BSD-style license found in the LICENSE file.