human_ids

Crates.iohuman_ids
lib.rshuman_ids
version0.1.1
sourcesrc
created_at2024-02-25 16:37:48.699644
updated_at2024-02-25 20:31:12.109356
descriptionGenerate human-readable IDs
homepagehttps://github.com/sondr3/human-ids
repositoryhttps://github.com/sondr3/human-ids
max_upload_size
id1152608
size16,410
Sondre Aasemoen (sondr3)

documentation

https://docs.rs/human_ids

README

human-ids

GitHub Actions Status Crates Crates

Create simple human readable IDs

Table of Contents

What?

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.

Library

Installation

  1. Add id: cargo add human_ids
  2. Use it: use human_ids::generate(None)

Usage

For usage documentation, see the docs.rs page.

Binary

Usage

$ 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

Completion

If your method of installation didn't include shell completion, you can manually source or save them with the human_ids --completion <shell> command.

Help

Finally, help is always available with human-ids -h (or --help if your installation included man pages).

Installation

Currently, the package is available a couple of places, including Homebrew, AUR and Nix.

Cargo
cargo install human-ids-bin
Homebrew
  1. brew tap sondr3/homebrew-taps
  2. 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.

LICENSE

MIT.

Commit count: 0

cargo fmt