forked from kleopatra999/seif
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.js
45 lines (40 loc) · 1.07 KB
/
install.js
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
/*jslint node: true */
// jshint esversion: 6
function initialize() {
'use strict';
const prompt = require('prompt');
prompt.start();
prompt.get(
[
{
name: 'dir',
description: 'Enter location to save entity credentials'
},
{
name: 'entity',
validator: /^[a-zA-Z\s\-]+$/,
warning: 'Entity must be only letters, spaces, or dashes'
},
{
name: 'password',
hidden: true
}
],
function (err, results) {
if (err !== null) {
console.log("Undefined Input.");
return;
}
const seif = require('seif-protocol')({folder: results.dir});
seif.createEntityIdentity(
results,
function (error) {
if (error !== undefined) {
console.log(error);
}
}
);
}
);
}
initialize();