|
@@ -40,7 +40,7 @@ core library for LessPass password manager in node.js used to generate unique pa |
|
|
<meta charset="UTF-8"> |
|
|
<meta charset="UTF-8"> |
|
|
</head> |
|
|
</head> |
|
|
<body> |
|
|
<body> |
|
|
<script src="dist/lesspass.min.js"></script> |
|
|
|
|
|
|
|
|
<script src="lesspass.min.js"></script> |
|
|
<script> |
|
|
<script> |
|
|
var login = 'contact@lesspass.com'; |
|
|
var login = 'contact@lesspass.com'; |
|
|
var masterPassword = 'password'; |
|
|
var masterPassword = 'password'; |
|
@@ -53,7 +53,7 @@ core library for LessPass password manager in node.js used to generate unique pa |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
lesspass.generatePassword(login, masterPassword, site, options).then(function (generatedPassword) { |
|
|
lesspass.generatePassword(login, masterPassword, site, options).then(function (generatedPassword) { |
|
|
console.log(generatedPassword) |
|
|
|
|
|
|
|
|
console.log(generatedPassword) //azYS7,olOL2] |
|
|
}); |
|
|
}); |
|
|
</script> |
|
|
</script> |
|
|
</body> |
|
|
</body> |
|
@@ -65,13 +65,44 @@ core library for LessPass password manager in node.js used to generate unique pa |
|
|
|
|
|
|
|
|
generate unique password based on login, masterPassword, site and options. |
|
|
generate unique password based on login, masterPassword, site and options. |
|
|
|
|
|
|
|
|
return: promise with generatedPassword |
|
|
|
|
|
|
|
|
paramaters : |
|
|
|
|
|
|
|
|
|
|
|
* `login`: string |
|
|
|
|
|
* `masterPassword`: string |
|
|
|
|
|
* `site`: string |
|
|
|
|
|
* option: dict with lesspass options |
|
|
|
|
|
* `counter`: integer (default: 1) |
|
|
|
|
|
* `password.length`: integer between 6 and 64 (default: 12) |
|
|
|
|
|
* `password.settings`: array of string in `lowercase`, `uppercase`, `numbers` or `symbols` (default: `['lowercase', 'uppercase', 'numbers', 'symbols']`) |
|
|
|
|
|
|
|
|
|
|
|
exemple : |
|
|
|
|
|
|
|
|
|
|
|
var options = { |
|
|
|
|
|
counter: 2, |
|
|
|
|
|
password: { |
|
|
|
|
|
length: 14, |
|
|
|
|
|
settings: ['lowercase', 'uppercase', 'numbers'] |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return: |
|
|
|
|
|
|
|
|
|
|
|
* promise with generated password |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lesspass.generatePassword(login, masterPassword, site, options) |
|
|
lesspass.generatePassword(login, masterPassword, site, options) |
|
|
.then(function (generatedPassword) { |
|
|
.then(function (generatedPassword) { |
|
|
|
|
|
|
|
|
|
|
|
console.log(generatedPassword); |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(function (error) { |
|
|
|
|
|
console.log(error); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
see **tests/api.tests.js** for more examples |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Tests |
|
|
## Tests |
|
|
|
|
|
|
|
|
npm test |
|
|
npm test |
|
|