-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpassword-store.js
More file actions
68 lines (58 loc) · 1.62 KB
/
password-store.js
File metadata and controls
68 lines (58 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env node
const read = require('read')
const FileInteraction = require('./file-interaction.js')
console.log('Welcome to password-store!\n')
read({
prompt: 'Domain:'
}, (dErr, domain, isDomainDefault) => {
if (dErr) return console.log(dErr)
read({
prompt: 'Encryption:',
default: 'sha256'
}, (dErr, encryption, isEncryptionDefault) => {
if (dErr) return console.log(dErr)
read({
prompt: 'Remove special characters (yes/no):',
default: 'no'
}, (rscErr, removeSpecialChars, isRSCDefault) => {
if (rscErr) return console.log(rscErr)
read({
prompt: 'Max length (number or else you are screwed):',
default: '100'
}, (mlErr, maxLength, isMaxLengthDefault) => {
if (mlErr) return console.log(mlErr)
read({
prompt: 'Digest (base64):',
default: 'base64'
}, (digErr, digest, isDigestDefault) => {
if (digErr) return console.log(digErr)
read({
prompt: 'Copy password (yes/no):',
default: 'yes'
}, (cpErr, copyPass, isCopyPassDefault) => {
if (cpErr) return console.log(cpErr)
read({
prompt: 'Show password (yes/no):',
default: 'no'
}, (spErr, showPass, isShowPassDefault) => {
if (spErr) return console.log(spErr)
let passwordPreset = {
domain: domain,
digest: digest,
maxLength: maxLength,
removeSpecialChars: removeSpecialChars,
encryption: encryption,
showPass: showPass,
copyPass: copyPass
}
let fi = new FileInteraction()
fi.add(passwordPreset)
console.log('')
console.log('Done!')
})
})
})
})
})
})
})