@small-tech/auto-encrypt 4.1.1 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,6 +12,8 @@ When not provisioning certificates, Auto Encrypt also forwards HTTP calls to HTT
12
12
 
13
13
  ## Compatibility
14
14
 
15
+ Node.js 18.20.0+.
16
+
15
17
  All tests pass on Node.js LTS (version 22).
16
18
 
17
19
  ## Installation
@@ -6,9 +6,7 @@
6
6
  * @license AGPLv3 or later.
7
7
  */
8
8
 
9
- import fs from 'fs'
10
- import path from 'path'
11
- import { fileURLToPath } from 'url'
9
+ import packageJson from '../package.json' with { type: 'json' }
12
10
  import jose from 'jose'
13
11
  import prepareRequest from 'bent'
14
12
  import types from '../typedefs/lib/AcmeRequest.js'
@@ -26,7 +24,6 @@ const throws = new Throws({
26
24
  [Symbol.for('AcmeRequest.requestError')]: error => `(${error.status} ${error.type} ${error.detail})`
27
25
  })
28
26
 
29
- const __dirname = fileURLToPath(new URL('.', import.meta.url))
30
27
  /**
31
28
  * Abstract base request class for carrying out signed ACME requests over HTTPS.
32
29
  *
@@ -39,7 +36,7 @@ export default class AcmeRequest {
39
36
  static nonce = null
40
37
  static __account = null
41
38
  /** @type {string} */
42
- static autoEncryptVersion = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'))).version
39
+ static autoEncryptVersion = packageJson.version
43
40
 
44
41
  static initialise (directory = throws.ifMissing(), accountIdentity = throws.ifMissing()) {
45
42
  this.directory = directory
@@ -172,9 +169,9 @@ export default class AcmeRequest {
172
169
  * Concatenates the output of a stream and returns a buffer. Taken from the bent module.
173
170
  *
174
171
  * @param {stream} stream A Node stream.
175
- * @returns {Buffer} The concatenated output of the Node stream.
172
+ * @returns {Promise<Buffer>} The concatenated output of the Node stream.
176
173
  */
177
- async getBuffer (stream) {
174
+ getBuffer (stream) {
178
175
  return new Promise((resolve, reject) => {
179
176
  const parts = []
180
177
  stream.on('error', reject)
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@small-tech/auto-encrypt",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "description": "Automatically provisions and renews Let’s Encrypt TLS certificates on Node.js https servers (including Kitten, Polka, Express.js, etc.)",
5
5
  "engines": {
6
- "node": ">=18.2.0"
6
+ "node": ">=18.20.0"
7
7
  },
8
8
  "keywords": [
9
9
  "let's encrypt",