Giter VIP home page Giter VIP logo

yawg's Introduction

YAWG - Yet Another Word Generator

Node CLI to generate XKCD inspired passwords, using common English words that are easy to spell and type in manually.

https://www.npmjs.com/package/yawg

Install

Install yawg globally with NPM package manager included with NodeJS:

$ npm install -g yawg        

Alternatively with Yarn package manager:

$ yarn global add yawg

Then run it:

$ yawg
cheese packet wish

Parameters

$ yawg -h
yawg - Yet Another Word Generator

version: 1.2.3

Required parameters: (none)

Optional parameters:
--delimiter=' '     Delimiter between words
--minLength=12      Min length of phrase
--maxLength=25      Max length of phrase
--minWords=3        Min number of words
--maxWords=5        Max number of words
--minWordLength=1   Min word length
--maxWordLength=8   Max word length
--attempts=10000    Max attempts per phrase
--count=1           Number of phrases to generate
    alias: -n
--help              Show this screen
    alias: -h

Examples

Copy phrase to clipboard

$ yawg | clip

Multiple phrases

$ yawg -n 10
dans mainly fly tray luke
yen craft marco ill jobs
ran situated bouquet
toys que wrist achieve
bless worry filme craft
justin shame toronto
trader reset dui gen lead
str disks antigua nest
marvel enables moms
trusted cleared unit

Short words only

$ yawg -n3 --maxWordLength=4
fork my core
mat fair hong
bras arm foul

Long phrases

$ yawg -n3 --minLength=25 --maxLength=50
offices language myrtle altered
recipes emission involves audience brighton
detailed exhibit industry

Node API

You can require this package in your NodeJS code and pass in the options as an object argument.

Example:

'use strict';

var yawg = require('yawg');

try {
    var phrase = yawg({
        minWords: 4,
        maxLength: 50,
        attempts: 100,
    });
    console.log('Phrase is: ' + phrase);
} catch (err) {
    // Not able to produce a phrase that mathed the constraints of the parameters.
    // Example: --maxLength=10 --minWords=5 --minWordLength=3  # Can only generate phrase of minimum length 5*13=15
}

Troubleshooting

  1. Sometimes Yarn on Windows does not properly configure the PATH environment variable. Make sure PATH is properly set up.
    • Find the global yarn bin path: $ yarn global bin # Ex: C:\Users\Andreas\AppData\Local\Yarn\bin
    • Append path to PATH env variable

yawg's People

Contributors

angularsen avatar rmarscher avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rmarscher sheeeng

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.