wrld-cmd 1.0.0
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.js +31 -0
- package/package.json +12 -0
package/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const readline = require('node:readline');
|
|
3
|
+
const { stdin: input, stdout: output } = require('node:process');
|
|
4
|
+
const MemoryStore = require('wrld-sdk');
|
|
5
|
+
const { hostname } = require('node:os');
|
|
6
|
+
|
|
7
|
+
var store = new MemoryStore()
|
|
8
|
+
const rl = readline.createInterface({ input, output });
|
|
9
|
+
|
|
10
|
+
async function auth_run (){
|
|
11
|
+
rl.question('Enter Password for ' + hostname(), async (a)=>{
|
|
12
|
+
const authPass = store.get('auth_pass');
|
|
13
|
+
|
|
14
|
+
if(!store.get('auth_pass')) {
|
|
15
|
+
store.set('auth_pass', a);
|
|
16
|
+
|
|
17
|
+
console.log('Authorization Password Was Set')
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
console.log('Authorization Successful')
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
isAuthed: true
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module.exports = {
|
|
29
|
+
store,
|
|
30
|
+
auth_run
|
|
31
|
+
};
|