@art-ws/ssl-info 1.0.4 → 1.0.7
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/{bin/index.js → cli.js} +1 -1
- package/index.js +41 -0
- package/package.json +4 -3
package/{bin/index.js → cli.js}
RENAMED
package/index.js
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
const sslChecker = require("ssl-checker")
|
2
|
+
const path = require("path");
|
3
|
+
|
4
|
+
async function main() {
|
5
|
+
const pckg = require(path.join(__dirname, "package.json"))
|
6
|
+
const app = Object.keys(pckg.bin)[0]
|
7
|
+
// https://www.npmjs.com/package/yargs
|
8
|
+
const { argv } = require("yargs")
|
9
|
+
.option("hostname", {
|
10
|
+
alias: "h",
|
11
|
+
type: "string",
|
12
|
+
description: "Hostname",
|
13
|
+
})
|
14
|
+
.option("property", {
|
15
|
+
alias: "p",
|
16
|
+
type: "string",
|
17
|
+
description:
|
18
|
+
"Property (daysRemaining, valid, validFrom, validTo, validFor)",
|
19
|
+
})
|
20
|
+
.usage(`Usage: ${app} `)
|
21
|
+
.epilog(
|
22
|
+
["https://art-ws.com", pckg.description ?? "", "Copyright 2022"].join(", ")
|
23
|
+
)
|
24
|
+
.example(`${app} google.com daysRemaining`, "")
|
25
|
+
|
26
|
+
const hostname = argv.hostname || argv._[0]
|
27
|
+
if (hostname) {
|
28
|
+
const prop = argv.hostname || argv._[1]
|
29
|
+
const info = await sslChecker(hostname)
|
30
|
+
if (prop) {
|
31
|
+
console.log(info[prop])
|
32
|
+
} else {
|
33
|
+
console.log(JSON.stringify(info))
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
module.exports = {
|
39
|
+
main
|
40
|
+
}
|
41
|
+
|
package/package.json
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "@art-ws/ssl-info",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.7",
|
4
4
|
"description": "Node SSL Checker",
|
5
5
|
"homepage": "https://github.com/art-ws/ssl-info",
|
6
|
+
"main": "index.js",
|
6
7
|
"license": "MIT",
|
7
8
|
"bin": {
|
8
|
-
"ssl-info": "
|
9
|
+
"ssl-info": "./cli.js"
|
9
10
|
},
|
10
11
|
"files": [
|
11
|
-
"
|
12
|
+
"*.js"
|
12
13
|
],
|
13
14
|
"author": {
|
14
15
|
"email": "art-ws@pm.me",
|