# easy-local-ssl

> Easily generate a self signed SSL for local development

Latest version **1.0.0** (published 2022-01-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install easy-local-ssl
pnpm add easy-local-ssl
yarn add easy-local-ssl
bun add easy-local-ssl
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-01-28 |
| First published | 2022-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 168.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Patrick Tran |
| Maintainers | patricktran |
| Keywords | ssl, https, ssl-certificate, localhost, self-signed-certificate |

## Links

- npm: https://www.npmjs.com/package/easy-local-ssl
- Repository: https://github.com/patricktran/easy-local-ssl
- Homepage: https://github.com/patricktran/easy-local-ssl#readme
- Issues: https://github.com/patricktran/easy-local-ssl/issues
- npm.io page: https://npm.io/package/easy-local-ssl

## Dependencies (2)

- [devcert](https://npm.io/package/devcert.md) ^1.2.0
- [prompts](https://npm.io/package/prompts.md) ^2.4.2

## Recent versions

- 1.0.0 (latest) — 2022-01-28

## README

# easy-local-ssl

Automatic self signed SSL generation for local development (MacOS/Windows).  
Powered by [devcert](https://www.npmjs.com/package/devcert).

[![NPM](https://img.shields.io/npm/v/easy-local-ssl.svg)](https://www.npmjs.com/package/easy-local-ssl) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

<br />

![screenshot](/easy-local-ssl.png?raw=true)

<br />

## Install

```bash
npm install --save easy-local-ssl
```

<br />

## Examples

Check out the examples folder:

- [with-create-react-app](https://github.com/patricktran/easy-local-ssl/tree/main/examples/with-create-react-app)
- [with-react-webpack](https://github.com/patricktran/easy-local-ssl/tree/main/examples/with-react-webpack)

<br />

## Usage

```js
const generateSslCert = require("easy-local-ssl");

// in your webpack config
const ssl = await generateSslCert();

...

// https://webpack.js.org/configuration/dev-server/#devserverhttps
devServerConfig.https = {
    key: ssl.key,
    cert: ssl.cert,
};

```

## Advanced Usage

The generateSslCert method accepts an `options` object.

| Property          | Description                                          | Default value | Type    |
| ----------------- | ---------------------------------------------------- | ------------- | ------- |
| `domain`          | custom domain for the auto generated ssl certificate | "localhost"   | string  |
| `modifyHostsFile` | modifying your /etc/hosts file for custom domains?   | true          | boolean |

```js

// specify a custom domain
const ssl = await generateSslCert({
    domain: "local.myapp.com",
    modifyHostsFile: true
});
```

## License

MIT © [patricktran](https://github.com/patricktran)

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