This repository has been archived by the owner on Feb 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
47 lines (38 loc) · 1.45 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env node
const chalk = require('chalk');
const { description, name, version } = require('./package.json')
const options = process.argv.slice(2) //arguments
const VERSION_MESSAGE = `${name} ${version}`
const LOGO = chalk.yellow(` __ __ ____ __ __ ____ __ __
/\\ \\/\\ \\/\\ _\`\\ /\\ \\/\\ \\ /\\ _\`\\ /\\ \\ /\\ \\
\\ \\ \\ \\ \\ \\ \\L\\ \\ \\ \`\\\\ \\ \\ \\ \\/\\_\\ \\ \\___ __ ___\\ \\ \\/'\\
\\ \\ \\ \\ \\ \\ ,__/\\ \\ , \` \\ \\ \\ \\/_/\\ \\ _ \`\\ /'__\`\\ /'___\\ \\ , <
\\ \\ \\_/ \\ \\ \\/ \\ \\ \\\`\\ \\ \\ \\ \\L\\ \\ \\ \\ \\ \\/\\ __//\\ \\__/\\ \\ \\\\\`\\
\\ \`\\___/\\ \\_\\ \\ \\_\\ \\_\\ \\ \\____/\\ \\_\\ \\_\\ \\____\\ \\____\\\\ \\_\\ \\_\\
\`\\/__/ \\/_/ \\/_/\\/_/ \\/___/ \\/_/\\/_/\\/____/\\/____/ \\/_/\\/_/`)
const HELP_MESSAGE = LOGO + chalk.yellow('v' + version) + `
${description}
Usage: vpn-check [command] {options...}
Commands:
nord Check Nord Vpn servers
test Test
logo Show logo
Options:
--help Help documentation
--version | -v Installed package version
`
function a(arg) { //Check arguments
return options.includes(arg)
}
if (a('-v') ||a('--version') ) {
console.log(VERSION_MESSAGE)
} else if (a('nord')) {
console.log(LOGO)
require('./nord')
} else if (a('test')) {
require('./test')
} else if (a('logo')) {
console.log(LOGO);
} else {
console.log(HELP_MESSAGE)
}