battery-staple

1.0.0 • Public • Published

BatteryStaple

BatteryStaple, or bs for short, is a really basic passphrase generator in the spirit of that one XKCD comic.

CLI Options

-l or --length

Specify number of words to generate. If no length is specified, 4 will be used.

Usage:

bs
#=> fameflower gemlike buckwagon quinia 
 
bs -l 6
#=> bleary fluted colonate garbling batoid foolish 
 
bs --length=5
#=> menacingly committor foreglance dodginess awninged 

Including Words

Any words not immediately following another command line flag will be considered a word you want to include. Additional words will be generated to bring the total word count up to the provided (or default) length.

Usage:

bs fish tortilla
#=> fish albite hypercube tortilla 
 
bs -l=3 pickle jinkies
#=> jinkies melatope pickle 

As A Module

You can also use it as a node module:

const bs = require('battery-staple');
 
bs({
    length: 7,
    include: ['orange', 'horripilate']
}).then(pass => {
    /* The `bs` function returns an array of word strings
       instead of the single string the CLI spits out:
 
       ['roed', 'pinweed', 'orange', 'slideable',
        'horripilate', 'predefray', 'francolite']
 
       That way you can do whatever additional processing
       you need, or you can just get a string out of it:
    */
 
    console.log(pass.join(' '));
    // roed pinweed orange slideable horripilate predefray francolite
});

Readme

Keywords

none

Package Sidebar

Install

npm i battery-staple

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • schwingbat