@art-ws/ssl-info 1.0.0 → 1.0.3
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 +8 -0
- package/package.json +5 -7
- package/index.js +0 -40
package/bin/index.js
ADDED
package/package.json
CHANGED
@@ -1,17 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "@art-ws/ssl-info",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.3",
|
4
4
|
"description": "Node SSL Checker",
|
5
5
|
"homepage": "https://github.com/art-ws/ssl-info",
|
6
6
|
"license": "MIT",
|
7
|
-
"main": "index.js",
|
8
|
-
"scripts": {
|
9
|
-
"build": "tsc",
|
10
|
-
"watch": "tsc --watch"
|
11
|
-
},
|
12
7
|
"bin": {
|
13
|
-
"ssl-info": "index.js"
|
8
|
+
"ssl-info": "bin/index.js"
|
14
9
|
},
|
10
|
+
"files": [
|
11
|
+
"bin"
|
12
|
+
],
|
15
13
|
"author": {
|
16
14
|
"email": "art-ws@pm.me",
|
17
15
|
"name": "art-ws Team",
|
package/index.js
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
const sslChecker = require("ssl-checker")
|
2
|
-
const path = require("path");
|
3
|
-
const pckg = require(path.join(__dirname, "package.json"))
|
4
|
-
|
5
|
-
const app = Object.keys(pckg.bin)[0]
|
6
|
-
|
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
|
-
async function main(argv) {
|
27
|
-
const hostname = argv.hostname || argv._[0]
|
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
|
-
main(argv).catch((e) => {
|
38
|
-
console.error(e)
|
39
|
-
process.exit(1)
|
40
|
-
})
|