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.

/pem-promise/

    Package Sidebar

    Install

    npm i pem-promise

    Weekly Downloads

    784

    Version

    1.0.0

    License

    ISC

    Last publish

    Collaborators

    • achingbrain