hi

human-id

πŸ’ƒπŸ†” Generates human readable identifier strings by chaning common (short) words of the english language.

Showing:

Popularity

Downloads/wk

57.5K

GitHub Stars

34

Maintenance

Last Commit

2yrs ago

Contributors

3

Package

Dependencies

0

Size (min+gzip)

2.8KB

License

MIT

Type Definitions

Built-In

Tree-Shakeable

Yes?

Categories

Readme

πŸ’ƒπŸ†”

Human-Readable Identifiers

Using words to identify datasets (instead of numbers) provides various advantages when humans are involved, ie increased distinction and rememberability.

Human-ID generates readable strings by chaining common short words of the english language in a semi-meaningful way. The result is concatenated of adjective + noun + verb resulting in a total of 13β€―024β€―368 possible combinations.

  • SFW: no bad words; family friendly results
  • No dependencies

Examples

  • FortyGhostsTalk
  • CalmPanthersDream
  • TastyRocksSparkle
  • HealthyCowsSmile
  • AfraidWallsExist
  • StrangeCarsRush
  • TwoKangaroosSing
  • HappyDolphinsJump

Install

Yarn

yarn add human-id

NPM

npm install human-id

Usage

import humanId from 'human-id'

// RareGeckosJam
humanId();

// Rare~Geckos~Jam
humanId('~');

// rare-geckos-jam
humanId({
  separator: '-',
  capitalize: false
});

API

humanId(options?: string | Option): string

Generates a human ID. Options can be a string for defining a separator, or an options object of:

  • separator string = '' - Separates the words from each other
  • capitalize boolean = true - Whether to transform the first character of each word to upper case

This is also the default export

adjectives: string[]

List of possible values for the first part of the human id.

nouns: string[]

List of possible values for the second part of the human id.

verbs: string[]

List of possible values for the third part of the human id.

poolSize: number

Returns 13024368 - the number of possible combinations.

minLength: number

The length of the shortest possible id (8).

maxLength: number

The length of the longest possible id (24).

πŸ’ƒπŸ†”

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100