# mkcert

> Create Self Signed Development Certificates

Latest version **3.2.0** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install mkcert
pnpm add mkcert
yarn add mkcert
bun add mkcert
```

Provides the command `mkcert`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2023-11-07 |
| First published | 2018-11-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 2 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 163 |
| Author | Subash Pathak |
| Maintainers | sbspk |
| Keywords | signed, certificate, cert |

## Links

- npm: https://www.npmjs.com/package/mkcert
- Repository: https://github.com/Subash/mkcert
- Homepage: https://github.com/Subash/mkcert#readme
- Issues: https://github.com/Subash/mkcert/issues
- npm.io page: https://npm.io/package/mkcert

## Dependencies (2)

- [commander](https://npm.io/package/commander.md) ^11.0.0
- [node-forge](https://npm.io/package/node-forge.md) ^1.3.1

## Recent versions

- 3.2.0 (latest) — 2023-11-07
- 3.1.0 — 2023-10-13
- 3.0.0 — 2023-08-24
- 2.0.0 — 2023-08-24
- 1.5.1 — 2022-08-14
- 1.5.0 — 2022-01-16
- 1.4.0 — 2020-09-23
- 1.3.0 — 2020-06-21
- 1.2.0 — 2019-01-31
- 1.1.0 — 2018-11-12
- 1.0.0 — 2018-11-11
- 0.0.5 — 2018-11-11
- 0.0.4 — 2018-11-11
- 0.0.3 — 2018-11-11
- 0.0.2 — 2018-11-11
- … 1 more at https://npm.io/package/mkcert/versions

## README

Create self signed tls certificates without OpenSSL.

## Install

```
npm install -g mkcert
```

## CLI

### Create a Certificate Authority

```
$ mkcert create-ca --help

  Options:
    --organization [value]  organization name (default: "Test CA")
    --country-code [value]  country code (default: "US")
    --state [value]         state name (default: "California")
    --locality [value]      locality address (default: "San Francisco")
    --validity [days]       validity in days (default: 365)
    --key [file]            output key file (default: "ca.key")
    --cert [file]           output certificate file (default: "ca.crt")
    -h, --help              display help for command
```

### Create a Certificate

```
$ mkcert create-cert --help

  Options:
    --ca-key [file]                  ca private key file (default: "ca.key")
    --ca-cert [file]                 ca certificate file (default: "ca.crt")
    --validity [days]                validity in days (default: 365)
    --key [file]                     output key file (default: "cert.key")
    --cert [file]                    output certificate file (default: "cert.crt")
    --organization [value]           optional organization name
    --email [value]                  optional email address
    --domains, --domain [values...]  domains or ip addresses (default: ["localhost","127.0.0.1"])
    -h, --help                       display help for command
```

## API

```js
import { createCA, createCert } from "mkcert";

const ca = await createCA({
  organization: "Hello CA",
  countryCode: "NP",
  state: "Bagmati",
  locality: "Kathmandu",
  validity: 365
});

const cert = await createCert({
  ca: { key: ca.key, cert: ca.cert },
  domains: ["127.0.0.1", "localhost"],
  validity: 365
});

console.log(cert.key, cert.cert); // certificate info
console.log(`${cert.cert}${ca.cert}`); // create full chain certificate by merging CA and domain certificates
```

---
_Source: https://npm.io/package/mkcert · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
