katsube / gpwd

Generate Password(random string) at CLI
https://www.npmjs.com/package/gpwd
MIT License
2 stars 0 forks source link

Human friendly mode `gpwd-h` #13

Open katsube opened 4 years ago

katsube commented 4 years ago

It is new command.

$ gpwd-h
applebananapine 

$ gpwd-h --caps
AppleBananaPine 

option

update configuration file ~/.gpwd.json

{
  "length": 8,
  "strength": "normal",
  "secure": false,
  "human": {
    "length": 8,
    "caps": false,
    "secure":false
  }
}

etc

change method name

genPassword.gen()genPassword.generate()

change module.exports style

current

module.exports = class genPassword {
  // .....
}

after

//-------------------
// lib/genPassword.js
//-------------------
class genPassword {
  // .....
}

//-------------------
// lib/genPasswordHuman.js
//-------------------
class genPasswordHuman{
  // .....
}

//-------------------
// index.js
//-------------------
module.exports = require("./lib/genPassword");
module.exports.human = require("./lib/genPasswordHuman");

example

const genPassword = require("../index.js");
const passwd  = new genPassword();

const genPasswordHuman = require("../index.js").human;
const passwdh  = new genPasswordHuman();
katsube commented 4 years ago

English dictionary

License