Nifty Procrastination Machine
Miss any of our Open RFC calls?Watch the recordings here! »

pem-promise

1.0.0 • Public • Published

pem-promise

Dependency status Build status Coverage status

Wraps pem in a promise compatible API.

Installation

$ npm install --save pem-promise

Usage

const pem = require('pem-promise')
const https = require('https')
 
pem.createCertificate({
  days: 1,
  selfSigned: true
})
  .then((keys) => {
    https.createServer({key: keys.serviceKey, cert: keys.certificate}, function(req, res) {
      res.end('o hai!')
    }).listen(443)
  })
  .catch((error) => {
    console.error(`Could not create certificate because ${error}`)
  })

All pem methods are wrapped. See the pem documentation for full details of the API.

Install

npm i pem-promise

DownloadsWeekly Downloads

824

Version

1.0.0

License

ISC

Last publish

Collaborators

  • avatar