diff --git a/readme.md b/readme.md index 4b9342a..fc16e11 100644 --- a/readme.md +++ b/readme.md @@ -40,7 +40,7 @@ core library for LessPass password manager in node.js used to generate unique pa - + @@ -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. -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) .then(function (generatedPassword) { - + console.log(generatedPassword); + }) + .catch(function (error) { + console.log(error); }); + +see **tests/api.tests.js** for more examples + + ## Tests npm test diff --git a/tests/karma.conf.js b/tests/karma.conf.js new file mode 100644 index 0000000..eb97c35 --- /dev/null +++ b/tests/karma.conf.js @@ -0,0 +1,20 @@ +module.exports = function (config) { + config.set({ + basePath: '..', + frameworks: ['mocha', 'chai'], + files: [ + 'src/**/*.js', + 'test/**/*.js' + ], + exclude: [], + preprocessors: {}, + reporters: ['progress'], + port: 9876, + colors: true, + logLevel: config.LOG_DISABLE, + singleRun: false, + autoWatch: true, + browsers: ['Firefox', 'Chrome'], + concurrency: Infinity + }); +};