Skip to content

achingbrain/pem-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

The pem module wrapped in a promises API

Resources

Stars

Watchers

Forks

Packages

No packages published