@art-ws/ssl-info 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/main.js +39 -0
  2. package/package.json +3 -2
package/main.js ADDED
@@ -0,0 +1,39 @@
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
+ const prop = argv.hostname || argv._[1]
28
+ const info = await sslChecker(hostname)
29
+ if (prop) {
30
+ console.log(info[prop])
31
+ } else {
32
+ console.log(JSON.stringify(info))
33
+ }
34
+ }
35
+
36
+ module.exports = {
37
+ main
38
+ }
39
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@art-ws/ssl-info",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Node SSL Checker",
5
5
  "homepage": "https://github.com/art-ws/ssl-info",
6
6
  "license": "MIT",
@@ -8,7 +8,8 @@
8
8
  "ssl-info": "bin/index.js"
9
9
  },
10
10
  "files": [
11
- "bin"
11
+ "bin",
12
+ "*.js"
12
13
  ],
13
14
  "author": {
14
15
  "email": "art-ws@pm.me",