@tushardev01/farm-password 1.0.10 → 1.0.11
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/README.md +13 -12
- package/app.js +0 -15
- package/cli.js +16 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Generates secure random passwords using lowercase, uppercase, numbers, and symbo
|
|
|
5
5
|
|
|
6
6
|
## Package Information
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
🔗 **npm Package**: [https://www.npmjs.com/package/@tushardev01/farm-password](https://www.npmjs.com/package/@tushardev01/farm-password)
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -17,15 +17,17 @@ Generates secure random passwords using lowercase, uppercase, numbers, and symbo
|
|
|
17
17
|
- CLI support (`genpass`)
|
|
18
18
|
- TypeScript typings included
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
#### To use genpass cli:
|
|
21
22
|
```bash
|
|
22
|
-
npm
|
|
23
|
-
|
|
23
|
+
npm install -g @tushardev01/farm-password
|
|
24
|
+
genpass
|
|
25
|
+
genpass -c
|
|
24
26
|
```
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
genpass: logs random password
|
|
29
|
+
genpass -c: logs random password and copies to clipboard
|
|
30
|
+
|
|
29
31
|
|
|
30
32
|
---
|
|
31
33
|
|
|
@@ -70,12 +72,12 @@ This generates a password with default settings.
|
|
|
70
72
|
```bash
|
|
71
73
|
genPassword(charLength?: number): string
|
|
72
74
|
Generates a password using default arrays
|
|
73
|
-
charLength
|
|
75
|
+
charLength – optional, default is 25
|
|
74
76
|
|
|
75
77
|
shuffleMax(charLength?: number, lists: string[][]): string[]
|
|
76
78
|
Randomly picks characters from multiple character arrays
|
|
77
|
-
charLength
|
|
78
|
-
lists
|
|
79
|
+
charLength – optional, default 25
|
|
80
|
+
lists – array of string arrays, e.g., [genLowerLetters(), genNumbers()]
|
|
79
81
|
|
|
80
82
|
genLowerLetters(): string[]
|
|
81
83
|
Returns lowercase letters: ['a','b',...,'z']
|
|
@@ -111,5 +113,4 @@ Types are included automatically via index.d.ts.
|
|
|
111
113
|
|
|
112
114
|
### License
|
|
113
115
|
|
|
114
|
-
ISC
|
|
115
|
-
|
|
116
|
+
ISC © Tushar Kumar
|
package/app.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import clipboard from 'clipboardy';
|
|
4
1
|
import {
|
|
5
2
|
genLowerLetters,
|
|
6
3
|
genUpperLetters,
|
|
@@ -12,18 +9,6 @@ import {
|
|
|
12
9
|
shuffle,
|
|
13
10
|
} from './utility.js';
|
|
14
11
|
|
|
15
|
-
const flag = process.argv[2]
|
|
16
|
-
const isCalledByGenPass = process.argv[1].includes("@tushardev01");
|
|
17
|
-
|
|
18
|
-
if (isCalledByGenPass) {
|
|
19
|
-
const password = genPassword();
|
|
20
|
-
console.log(password);
|
|
21
|
-
|
|
22
|
-
if (flag && flag === '-c') {
|
|
23
|
-
clipboard.writeSync(password)
|
|
24
|
-
console.log("Copied to clipboard!!");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
12
|
export {
|
|
28
13
|
genLowerLetters,
|
|
29
14
|
genUpperLetters,
|
package/cli.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import clipboard from 'clipboardy';
|
|
4
|
+
import { genPassword } from './utility.js';
|
|
5
|
+
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
const copy = args.includes('-c');
|
|
8
|
+
|
|
9
|
+
const password = genPassword();
|
|
10
|
+
console.log(password);
|
|
11
|
+
|
|
12
|
+
if (copy) {
|
|
13
|
+
clipboard.writeSync(password);
|
|
14
|
+
console.log('Copied to clipboard!!');
|
|
15
|
+
}
|
|
16
|
+
|
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tushardev01/farm-password",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./app.js",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./app.js"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
|
-
"genpass": "./
|
|
10
|
+
"genpass": "./cli.js"
|
|
11
11
|
},
|
|
12
12
|
"types": "./index.d.ts",
|
|
13
13
|
"files": [
|
|
14
|
+
"cli.js",
|
|
14
15
|
"app.js",
|
|
15
16
|
"utility.js",
|
|
16
17
|
"README.md",
|