Socket
Socket
Sign inDemoInstall

mngen

Package Overview
Dependencies
51
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

mngen

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


Version published
Maintainers
1
Weekly downloads
396
decreased by-7.26%

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

FAQs

Last updated on 21 Nov 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc