diff --git a/README.md b/README.md index 2c210cb..dea79dc 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ A Node.js wrapper for [Let’s Encrypt](https://letsencrypt.org)’s [Pebble](https://github.com/letsencrypt/pebble) (“a small RFC 8555 ACME test server not suited for a production certificate authority”). + - Downloads the correct Pebble binary for your platform. + - Launches and manages a single Pebble process. - Returns a reference to the same process on future calls (safe to include in multiple unit tests where order of tests is undetermined) @@ -10,7 +12,7 @@ A Node.js wrapper for [Let’s Encrypt](https://letsencrypt.org)’s [Pebble](ht ## Version and platform support -Supports [Pebble version 2.3.0](https://github.com/letsencrypt/pebble/releases/tag/v2.3.0) under [Node.js LTS](https://nodejs.org/en/about/releases/) on platforms with binary [Pebble releases](https://github.com/letsencrypt/pebble/releases/): +Supports [Pebble version 2.3.1](https://github.com/letsencrypt/pebble/releases/tag/v2.3.1) under [Node.js LTS](https://nodejs.org/en/about/releases/) on platforms with binary [Pebble releases](https://github.com/letsencrypt/pebble/releases/): - Linux AMD 64. - Windows AMD 64. @@ -21,9 +23,11 @@ Supports [Pebble version 2.3.0](https://github.com/letsencrypt/pebble/releases/t npm i @small-tech/node-pebble ``` +As part of the post-installation process, Node Pebble will download the correct Pebble binary for your platform for use at runtime. + ## API -### Pebble.ready ([args], [env]) -> Promise +### Pebble.ready ([args], [env]) -> Promise<ChildProcess> Promises to get the Pebble server ready for use. Resolves once Pebble server is launched and ready and Node.js’s TLS module has been patched to accept Pebble server’s [test certificate](https://github.com/letsencrypt/pebble#avoiding-client-https-errors) as well as its [dynamically-generated root and intermediary CA certificates](https://github.com/letsencrypt/pebble#ca-root-and-intermediate-certificates). @@ -88,27 +92,23 @@ Pebble.ready('-config customConfig.json') The following listing launches the Pebble server with its default settings and then shuts it down. ```js -const Pebble = require('..') - -async function main() { - console.log('\n⏳ Launching Pebble server…\n') +import Pebble from '@small-tech/node-pebble' - await Pebble.ready() +console.log('\n⏳ Launching Pebble server…\n') - console.log('✔ Pebble server launched and ready.') - console.log('✔ Node.js’s TLS module patched to accept Pebble’s CA certificates.') +await Pebble.ready() - // Do stuff that requires Pebble here. - // … +console.log('✔ Pebble server launched and ready.') +console.log('✔ Node.js’s TLS module patched to accept Pebble’s CA certificates.') - console.log('\n⏳ Shutting down Pebble server…\n') +// Do stuff that requires Pebble here. +// … - await Pebble.shutdown() +console.log('\n⏳ Shutting down Pebble server…\n') - console.log('✔ Pebble server shut down.\n') -} +await Pebble.shutdown() -main() +console.log('✔ Pebble server shut down.\n') ``` ## Install development dependencies (for tests and coverage) @@ -120,13 +120,13 @@ npm install ## Run test task ```sh -npm test +npm -s test ``` ## Run coverage task ```sh -npm run coverage +npm -s run coverage ``` ## Like this? Fund us! @@ -137,7 +137,7 @@ We exist in part thanks to patronage by people like you. If you share [our visio ## Copyright -© 2020 [Aral Balkan](https://ar.al), [Small Technology Foundation](https://small-tech.org). +© 2020-2021 [Aral Balkan](https://ar.al), [Small Technology Foundation](https://small-tech.org). Let’s Encrypt is a trademark of the Internet Security Research Group (ISRG). All rights reserved. Node.js is a trademark of Joyent, Inc. and is used with its permission. We are not endorsed by or affiliated with Joyent or ISRG.