js-generate-password 0.0.5 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +58 -0
- package/index.js +2 -4
- package/package.json +3 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
interface GenerateOptions {
|
|
2
|
+
/**
|
|
3
|
+
* lenght of the password
|
|
4
|
+
* @default 10
|
|
5
|
+
*/
|
|
6
|
+
length?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Should the password include lowercase characters
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
lowercase?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Should the password include uppercase characters
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
uppercase?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Should the password include numbers
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
numbers?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Should the password include symbol characters
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
symbols?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* List of characters to be excluded from the password
|
|
29
|
+
* @default ""
|
|
30
|
+
*/
|
|
31
|
+
exclude?: string;
|
|
32
|
+
/**
|
|
33
|
+
* min lentgh of lowercase character
|
|
34
|
+
* @default 1
|
|
35
|
+
*/
|
|
36
|
+
minLengthLowercase?: number;
|
|
37
|
+
/**
|
|
38
|
+
* min lentgh of uppercase character
|
|
39
|
+
* @default 1
|
|
40
|
+
*/
|
|
41
|
+
minLengthUppercase?: number;
|
|
42
|
+
/**
|
|
43
|
+
* min length of numbers
|
|
44
|
+
* @default 1
|
|
45
|
+
*/
|
|
46
|
+
minLengthNumbers?: number;
|
|
47
|
+
/**
|
|
48
|
+
* min length of symbols
|
|
49
|
+
* @default 0
|
|
50
|
+
*/
|
|
51
|
+
minLengthSymbols?: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare namespace GeneratePassword {}
|
|
55
|
+
|
|
56
|
+
declare function GeneratePassword(options?: GenerateOptions): string;
|
|
57
|
+
|
|
58
|
+
export = GeneratePassword;
|
package/index.js
CHANGED
|
@@ -8,11 +8,9 @@ function GeneratePassword(options) {
|
|
|
8
8
|
errorCheck(options);
|
|
9
9
|
|
|
10
10
|
const pswd = passwords(options);
|
|
11
|
-
console.log("password: ", pswd);
|
|
12
11
|
|
|
13
12
|
return pswd;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
module.exports = GeneratePassword;
|
|
15
|
+
exports.default = GeneratePassword;
|
|
16
|
+
// module.exports = GeneratePassword;
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js-generate-password",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Password Generator for using in javascirpt/typscript based projects.",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"bin": "index.js",
|
|
8
|
+
"exports": "./index.js",
|
|
9
|
+
"types": "index.d.ts",
|
|
8
10
|
"scripts": {
|
|
9
11
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
12
|
},
|