Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

mngen

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Issues
File Explorer

Advanced tools

mngen

Mnemonic Word Generator. Generate words that are easy to read/say/understand/remember.

    1.1.0latest

Version published
Maintainers
1
Yearly downloads
7,186
decreased by-13.85%

Weekly downloads

Readme

Source

mnGen - Mnemonic Word Generator

Spits out random words from this word list.

The word list consists of 1633 words that are easy to read, say, understand and remember. They are also easy to distinguish from one another.

"... suitable for transmission or storage by voice, handwriting, memorization or other non-computerized means."

You could use it to generate easy-to-remember passwords or name your servers. Or dogs. Sometimes you just need a few top-notch words thrown at you.

Install

$ npm install --save mngen

Usage

var mnGen = require('mngen'); mnGen.word(); // => 'tokyo' mnGen.word(3); // => "office-piano-fabric" mnGen.list(3); // => ['canoe', 'amigo', 'kermit'] mnGen.list(3, 2); // => ['fuji-visa', 'kilo-lemon', 'baker-echo'] mnGen.list(3, 2, '/'); // => ['fuji/visa', 'kilo/lemon', 'baker/echo'] mngen.list(2665057, 2); // => ERR: Max list length for [glue] === 2 is 2665056

API

.word([[glue], [separator]])

Returns: String

  • Get a single random word
  • Give an integer glue to make it a dash-joined combo of multiple words.
  • Specify separator to customize separator between combos of multiple words.
mnGen.word(); // => "eagle" mnGen.word(3); // => "office-piano-fabric" mnGen.word(3, '/'); // => "office/piano/fabric"

.list([length, [glue], [separator]])

Returns: Array

  • Get an array of random words.
  • Default length is 100
  • Array entries are unique.
  • Specify glue to make entries dash-joined combos of multiple words.
  • Specify separator to customize separator between combos of multiple words.
  • Throws error if length > possible unique entries given glue (See Usage for example)
nmGen.list(); // => An array of 100 unique words mnGen.list(3); // => ['canoe', 'amigo', 'kermit'] mnGen.list(3, 2); // => ['fuji-visa', 'kilo-lemon', 'baker-echo'] mnGen.list(3, 2, '/'); // => ['fuji/visa', 'kilo/lemon', 'baker/echo']

CLI

$ npm install --global mngen

$ mngen # => tokyo $ mngen --glue 2 # => "english-legal" $ mngen --glue 2 --separator / # => "dexter/toronto" $ mngen --list 3 # => canoe amigo kermit $ mngen --list 2 --glue 3 # => oxford-soviet-rubber shave-deal-freddie

TODO

  • Add options:
    • Choose entry separator for list in cli (comma, newline, space, etc)
    • Custom word-lists

Thanks

Inspired by Sindre Sorhus

Keywords

Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc