1.0.7 • Published 2 years ago

@dmitryusenko/checksslcertificate v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm version

checkSslCertificate

A module which allows you to check the certificate of a given hostname is valid.

  • Typescript support

This module returns a Promise which will always resolve.

In case of an error the returned object will contain have an error property.

Installation

To install this package run:

$ npm install @dmitryusenko/checksslcertificate --save 
# Or
$ yarn add @dmitryusenko/checksslcertificate

Usage

import { checkSslCertificate } from '@dmitryusenko/checksslcertificate'
// or 
// const { checkSslCertificate } = require('@dmitryusenko/checksslcertificate')

checkSslCertificate({hostname: 'github.com'}).then(res => {
   console.log(res)
})

Options

UrlObject

PropertiesTypeRequiredDefaultExample
hostnamestringtrue-'example.com'
methodstringfalse'HEAD''GET'
pathstringfalse-'/foo'
portnumberfalse443444

Return Value

SslCheckResponse

PropertiesTypeOptionalExample
errorstringtrue
originalObjectUrlObjectfalse{hostname: 'example.com'}
validbooleanfalsetrue
validFromstringtrue'May 8 00:00:00 2018 GMT'
validUntilstringtrue'Jun 3 12:00:00 2020 GMT'