Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mnemonic-id

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mnemonic-id

Library to generate easy to remember and sometimes entertaining human readable ids

  • 0.9.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Mnemonic id

Library to generate easy to remember and sometimes entertaining human readable ids.

Inspired by major mnemonic system: https://en.wikipedia.org/wiki/Mnemonic_major_system

Examples

getName()

Generates ids that strike a balance between conciseness and number of permutation.

≈ 10^6 permutations

Output:

hot-splendid-duck
spicy-new-skunk
ancient-sour-fish
wicked-mean-rattlesnake

getShortName()

Generates concise ids for when only a small number of instances is needed.

≈ 10^4 permutations

Output:

massive-bulldog
thin-mouse
happy-eagle
giant-turkey

getAction()

Generates action-oriented ids.

≈ 10^6 permutationsW

Output:

marry-odd-dog
fry-splendid-elephant
bury-old-walrus
love-pretty-sheep

getStory()

Generates story-oriented ids.

≈ 10^10 permutations

Output:

fluffy-dragon-fly-nervous-pug
neat-warthog-erase-evil-rat
modern-fox-lull-shy-dog
cuddly-bird-defy-moody-badger

getCustom({...})

If neither of the predefined formats fits your use case, the output is fully customizable through the options parameter:

getCustom({
      adj: 2,
      subject: true,
      verb: true,
      object: true,
      delimiter: '_',
      idSuffix: 6,
      numberSuffix: 4,
    })
);

Output:

proud_evil_dolphin_meet_tidy_fluffy_crab_yO2vLY_3331
orange_spicy_horse_bite_tiny_calm_liger_NvnhdC_1669
nasty_big_rabbit_lick_fresh_cold_ape_lPz4kC_8196
fresh_wicked_lizard_chain_horrible_sour_fox_rKTiYL_3454

The options object can also be used with any other method to override default behavior.

License

Licensed under MIT.

Keywords

FAQs

Package last updated on 10 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc