npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

lets-encrypt-acme-client

v50.0.1

Published

Automatically Create and Renew LetsEncrypt! SSL Certificates, including Wildcard Certificates for supported DNS Providers

Downloads

71

Readme

LetsEncrypt! ACME Client

Automatically Create and Renew LetsEncrypt! SSL Certificates, including Wildcard Certificates for supported DNS Providers

Getting Started

import LetsEncryptDaemon from 'lets-encrypt-acme-client';

Simple Usage Example

Create a LetsEncryptDaemon and then start the Daemon

const daemon = new LetsEncryptDaemon();
await daemon.startLetsEncryptDaemon(...); // You can only start this once, it will configure itself to run again.
daemon.checkChallengesMixin(...); // You must check the HTTP-01 Challenges for each LetsEncryptDaemon

Complete Example Usage

This most recent version of this package is implemented in SSL Server

You can use SSL Server to understand how it works if the jsdoc isn't enough information.


Wild Card Certificates

| Supported DNS Providers | |-------------------------| | Cloud Flare |

You can generate Wild Card Certificates if you are using a supported DNS Provider

let dnsProvider = {
    name: "Cloud Flare",
    token: "apiTokenWithDnsEditPermission",
    zone: "zoneId" // optional if it cant be found automatically.
}

DNS Providers are used to complete DNS-01 challenges


LetsEncrypt! Daemon

LetsEncryptDaemon is the default exported class

const daemon = new LetsEncryptDaemon();

Daemon

The Daemon runs periodically to Create or Renew the Certificate

Jsdoc

/**
 * Starts the LetsEncrypt! Daemon to Manage a SSL Certificate
 *
 * @param {Array<string>} fqdns - The fully qualified domain names as a SAN (e.g., ["example.com", "www.example.com"]), You must use a `dnsProvider` if you include a wild card
 * @param {string} sslPath - The path where your acme account, keys and generated certificate will be stored or loaded from
 * @param {function} certificateCallback - Callback that can be used to update the current certificate or trigger a restart etc.
 * @param {boolean} [optGenerateAnyway=false] - (optional) True to generate a new certificate before the recommended time.
 * @param {boolean} [optStaging=false] - (optional) True to use staging mode instead of production.
 * 
 * @param {Object} dnsProvider - (optional) credentials for a supported dns provider if you want to use the `DNS-01` Challenge instead of `HTTP-01`
 * @example
 * const dnsProvider = {
 *     name: "Cloud Flare",
 *     token: "dnsEditPermissionApiToken",
 *   //zone: "zoneId", // if it cant be found automatically
 * }
 * @note
 * If you start this more than once nothing will happen
 */

Usage

await daemon.startLetsEncryptDaemon(fqdns, sslPath, certificateCallback, optGenerateAnyway = false, optStaging = false, dnsProvider = undefined)

HTTP Mixin for HTTP-01

HTTP Mixin that completes the HTTP-01 Challenges created by the Daemon

This is not required if you are using a DNS Provider

Jsdoc

/**
 * Node.js Middleware function to check and respond to ACME HTTP-01 challenges issued by this LetsEncryptDaemon inside the HTTP Server.
 *
 * @example
 * createServerHTTP(async (req, res) => {
 *     if (STATE.optLetsEncrypt && checkChallengesMixin(req, res)) { return; } 
 *     // normal request redirect etc
 * }).listen(80);
 */

Usage

if (daemon.checkChallengesMixin(req, res)) { return; } // Inside the HTTP Server

Challenges

The DNS-01 and HTTP-01 challenges have been implemented