-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
32 lines (25 loc) · 823 Bytes
/
index.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
#!/usr/bin/env node
const init = require('./utils/init');
const cli = require('./utils/cli');
const encrypt = require('./utils/encrypt');
const decrypt = require('./utils/decrypt');
const input = cli.input;
const flags = cli.flags;
const { clear } = flags;
(async () => {
init({ clear });
input.includes(`help`) && cli.showHelp(0);
// check if encrypt is present in flags object
if (flags.encrypt) {
await encrypt(flags);
} else if (flags.decrypt) {
await decrypt(flags);
}
// footer to show when the program is finished
const chalk = (await import(`chalk`)).default;
// print Give it a star on github: https://github.com/AvijeetJain/pixelDust with chalk and bgMagenta
console.log(
chalk.bgMagenta(` Give it a star on github: `) +
chalk.bold(` https://github.com/AvijeetJain/pixelDust `)
);
})();