human_ids 0.1.1

Generate human-readable IDs
Documentation
  • Coverage
  • 40.91%
    9 out of 22 items documented7 out of 12 items with examples
  • Size
  • Source code size: 16.32 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.02 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • sondr3/human-ids
    2 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • sondr3

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.

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.