@art-ws/ssl-info 1.0.1 → 1.0.2

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 (3) hide show
  1. package/bin/index.js +8 -0
  2. package/index.js +25 -26
  3. package/package.json +2 -2
package/bin/index.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { main } = require("../index.js")
4
+
5
+ main().catch((e) => {
6
+ console.error(e)
7
+ process.exit(1)
8
+ })
package/index.js CHANGED
@@ -1,29 +1,28 @@
1
1
  const sslChecker = require("ssl-checker")
2
2
  const path = require("path");
3
- const pckg = require(path.join(__dirname, "package.json"))
4
3
 
5
- const app = Object.keys(pckg.bin)[0]
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`, "")
6
25
 
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
26
  const hostname = argv.hostname || argv._[0]
28
27
  const prop = argv.hostname || argv._[1]
29
28
  const info = await sslChecker(hostname)
@@ -34,7 +33,7 @@ async function main(argv) {
34
33
  }
35
34
  }
36
35
 
37
- main(argv).catch((e) => {
38
- console.error(e)
39
- process.exit(1)
40
- })
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.1",
3
+ "version": "1.0.2",
4
4
  "description": "Node SSL Checker",
5
5
  "homepage": "https://github.com/art-ws/ssl-info",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "watch": "tsc --watch"
10
10
  },
11
11
  "bin": {
12
- "ssl-info": "./index.js"
12
+ "ssl-info": "bin/index.js"
13
13
  },
14
14
  "author": {
15
15
  "email": "art-ws@pm.me",