Crates.io | human_ids |
lib.rs | human_ids |
version | 0.1.1 |
source | src |
created_at | 2024-02-25 16:37:48.699644 |
updated_at | 2024-02-25 20:31:12.109356 |
description | Generate human-readable IDs |
homepage | https://github.com/sondr3/human-ids |
repository | https://github.com/sondr3/human-ids |
max_upload_size | |
id | 1152608 |
size | 16,410 |
Create simple human readable IDs
This is a Rust "fork" of the TypeScript/JavaScript library human-id
written by RienNeVaPlus, just rewritten in Rust. Used to generate friendly
IDs like those used in changesets
. Can be used either as a library or a binary.
cargo add human_ids
use human_ids::generate(None)
For usage documentation, see the docs.rs page.
$ human_ids -h
Usage: human_ids [OPTIONS]
Options:
--completion <COMPLETION>
Generate shell completion scripts [possible values: bash, elvish, fish, powershell, zsh]
-s, --separator <SEPARATOR>
The separator to use between words [default: -]
-c, --capitalize
Capitalize each word
-a, --adverb
Add an adverb
-n, --num-adjectives <NUM_ADJECTIVES>
The number of adjectives to use [default: 1]
-h, --help
Print help (see more with '--help')
-V, --version
Print version
$ human_ids -s '~' -c
Happy~Mirrors~Matter
If your method of installation didn't include shell completion, you can manually
source or save them with the human_ids --completion <shell>
command.
Finally, help is always available with human-ids -h
(or --help
if your installation
included man pages).
Currently, the package is available a couple of places, including Homebrew, AUR and Nix.
cargo install human-ids-bin
brew tap sondr3/homebrew-taps
brew install human-ids-bin
You can also download the matching release from the release
tab, extracting the archive and
placing the binary in your $PATH
. Note that for Linux the
unknown-linux-musl.tar.gz
is preferred as it is statically linked and thus
should run on any Linux distribution.
MIT.