From 754c623cd157428fb90395b0b7bc02642f41e767 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 26 Oct 2019 00:41:15 -0600 Subject: [PATCH] v3.0.4: update docs --- README.md | 18 +++++++++++++++++- package.json | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 601acb1..ef0458c 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,23 @@ ACME.js is a _low-level_ client for Let's Encrypt. Looking for an **easy**, _high-level_ client? Check out [Greenlock.js](https://git.rootprojects.org/root/greenlock.js). +```js +var acme = ACME.create({ maintainerEmail, packageAgent, notify }); +await acme.init(directoryUrl); + +// Create Let's Encrypt Account +var accountOptions = { subscriberEmail, agreeToTerms, accountKey }; +var account = await acme.accounts.create(accountOptions); + +// Validate Domains +var certificateOptions = { account, accountKey, csr, domains, challenges }; +var pems = await acme.certificates.create(certificateOptions); + +// Get SSL Certificate +var fullchain = pems.cert + '\n' + pems.chain + '\n'; +await fs.promises.writeFile('fullchain.pem', fullchain, 'ascii'); +``` + # Online Demo See https://greenlock.domains @@ -186,7 +203,6 @@ A basic example includes the following: [examples/README.md](https://git.rootprojects.org/root/acme.js/src/branch/master/examples/README.md) covers all of these steps, with comments. - # Install To make it easy to generate, encode, and decode keys and certificates, diff --git a/package.json b/package.json index ebc1d39..0fa08b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@root/acme", - "version": "3.0.2", + "version": "3.0.4", "description": "Free SSL certificates for Node.js and Browsers. Issued via Let's Encrypt", "homepage": "https://rootprojects.org/acme/", "main": "acme.js",