make-cert
Version:
Quickly generate a self-signed cert to start an HTTPS server
32 lines (24 loc) • 1.01 kB
Markdown
# make-cert
[](https://www.npmjs.com/package/make-cert)
[](https://github.com/vinsonchuong/make-cert/actions?query=workflow%3ACI)
[](https://david-dm.org/vinsonchuong/make-cert)
[](https://david-dm.org/vinsonchuong/make-cert?type=dev)
Quickly generate a self-signed cert to start an HTTPS server
## Usage
Install [make-cert](https://www.npmjs.com/package/make-cert)
by running:
```sh
yarn add make-cert
```
To generate a `key.pem` with the private key and `cert.pem` with the
certificate, both in PEM format, run:
```sh
yarn make-cert localhost
```
To use this in your own JavaScript code:
```js
import makeCert from 'make-cert'
const {key, cert} = makeCert('localhost')
console.log(key)
console.log(cert)
```