Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@

Run `yarn test:types` to execute the lightweight [tsd](https://github.com/SamVerschueren/tsd) assertions that guard the definitions.

## ESM

`pem` ships dual CommonJS + ESM entries. In ES modules, both the default and
every public function are importable:

```js
/* eslint-disable import/no-unresolved, @typescript-eslint/no-unused-vars -- documented example, 'pem' is this package */
import pem from 'pem' // everything, like require('pem')

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.1.8)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.4.8)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 4.1.0)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.2.6)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.5.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 4.1.0)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 1.1.1w)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 4.0.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.9.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.0.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.4.8)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.1.5)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.0.22)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.3.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.0.1)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.7.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 4.1.0)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 4.0.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.1.5)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.3.7)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.5.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.2.7)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.4.0)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.2.6)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.2.6)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.3.6)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.0.22)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.1.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.0.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.2.7)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.6.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.5.9)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM in FIPS mode (Node 24, OpenSSL 3.5.9)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.2.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.2.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM in FIPS mode (Node 22, OpenSSL 3.5.9)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.7.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.5.9)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM in FIPS mode (Node 26, OpenSSL 3.5.9)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.4.0)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.3.6)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.0.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.2.7)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.8.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.4.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.3.6)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 1.1.1w)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.5.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.5.9)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.1.8)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.0.1)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.1.8)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.3.7)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.4.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.3.7)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.3.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.8.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 4.0.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 1.1.1w)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.6.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.9.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.2.6)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.4.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.1.5)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.5.9)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.6.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 1.1.1w)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.0.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.0.22)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.5.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.6.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.3.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.8.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.1.5)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.3.7)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.0.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.2.7)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 4.0.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.7.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 4.1.0)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.1.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.1.8)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.3.7)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.1.5)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.9.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.1.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 4.2.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.2.7)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.2.6)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.4.8)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 4.3.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 4.0.1)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.8.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.5.9)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 4.1.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.9.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 4.4.0)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.4.8)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.7.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.5.9)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 4.1.0)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.0.22)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.0.22)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.5.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.4.8)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.3.6)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.4.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 4.0.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.3.6)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.3.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.0.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.0.1)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 1.1.1w)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.4.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.2.7)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.2.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.4.0)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 1.1.1w)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.1.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.3.7)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.0.1)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.1.8)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.7.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.9.2)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.2.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.2.6)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.1.8)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.4.8)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.8.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.6.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.4.0)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.4.3)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.5.4)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.3.6)

'pem' imported multiple times

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 4.0.3)

'pem' imported multiple times
import { createCertificate, createCSR, convert, promisified } from 'pem'

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.1.8)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.4.8)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 4.1.0)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.2.6)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.5.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 4.1.0)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 1.1.1w)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 4.0.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.9.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.0.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.4.8)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.1.5)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.0.22)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.3.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.0.1)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.7.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 4.1.0)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 4.0.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.1.5)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.3.7)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.5.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.2.7)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.4.0)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.2.6)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.2.6)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.3.6)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.0.22)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.1.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.0.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.2.7)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.6.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.5.9)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM in FIPS mode (Node 24, OpenSSL 3.5.9)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.2.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.2.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM in FIPS mode (Node 22, OpenSSL 3.5.9)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.7.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.5.9)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM in FIPS mode (Node 26, OpenSSL 3.5.9)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.4.0)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.3.6)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.0.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.2.7)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.8.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.4.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.3.6)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 1.1.1w)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.6.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.5.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.5.9)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.1.8)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.0.1)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.1.8)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.3.7)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.4.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.3.7)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.3.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.8.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 4.0.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 1.1.1w)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.6.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.9.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.2.6)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.4.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.1.5)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.5.9)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.6.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 1.1.1w)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.0.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.0.22)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.5.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.3.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.8.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.1.5)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.3.7)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.0.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.2.7)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 4.0.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.7.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 4.1.0)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.1.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.1.8)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.3.7)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.1.5)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.9.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.1.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 4.2.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.2.7)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.2.6)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.4.8)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 4.3.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 4.0.1)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.8.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.5.9)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 4.1.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.9.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 4.4.0)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.4.8)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.7.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.5.9)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 4.1.0)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.0.22)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.0.22)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.5.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.4.8)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.3.6)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.4.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 4.0.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.3.6)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.3.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.0.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.0.1)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 1.1.1w)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 3.4.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.2.7)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.2.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 4.4.0)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 1.1.1w)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.1.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.3.7)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.0.1)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.1.8)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.7.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.9.2)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.2.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, openssl 3.2.6)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, openssl 3.1.8)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 3.4.8)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.8.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 24, libressl 3.6.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 22, libressl 4.4.0)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.4.3)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.5.4)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, libressl 3.3.6)

'pem' imported multiple times

Check warning on line 41 in README.md

View workflow job for this annotation

GitHub Actions / Test PEM (Node 26, openssl 4.0.3)

'pem' imported multiple times
```

Both entry points share one runtime instance, so configuration done through
one (`pem.config({...})`) is visible to the other.

## Breaking changes in 2.0.0

2.0.0 hardens `pem` against configuration injection and denial of service. Two behavior changes are breaking:
Expand Down
31 changes: 31 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// ESM entry for pem.
// Imports the CJS bundle and re-exports the full public surface as named
// exports so `import pem from 'pem'` and `import { createCertificate } from 'pem'`
// both resolve to the same runtime object as `require('pem')`. Both modes share
// one module instance: Node caches ./dist/index.js as CJS, so the wrapper's
// import and a require() call see identical state (e.g. pem.config).
// The named list MUST stay in lockstep with the CJS surface — enforced by
// test/esm.spec.js and the esm-surface check.
import pem from './dist/index.js'

export default pem

export const createPrivateKey = pem.createPrivateKey
export const createDhparam = pem.createDhparam
export const createEcparam = pem.createEcparam
export const createCSR = pem.createCSR
export const createCertificate = pem.createCertificate
export const readCertificateInfo = pem.readCertificateInfo
export const getPublicKey = pem.getPublicKey
export const getFingerprint = pem.getFingerprint
export const getModulus = pem.getModulus
export const getDhparamInfo = pem.getDhparamInfo
export const createPkcs12 = pem.createPkcs12
export const readPkcs12 = pem.readPkcs12
export const verifySigningChain = pem.verifySigningChain
export const checkCertificate = pem.checkCertificate
export const checkPkcs12 = pem.checkPkcs12
export const config = pem.config
export const convert = pem.convert
export const CA = pem.CA
export const promisified = pem.promisified
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,21 @@
"url": "https://github.com/Dexus/pem.git"
},
"main": "./dist/index.js",
"exports": {
".": {
"types": "./types/pem.d.ts",
"import": "./index.mjs",
"require": "./dist/index.js"
},
"./lib/*.js": "./lib/*.js",
"./lib/*": "./lib/*.js",
"./package.json": "./package.json"
},
"files": [
"dist",
"lib",
"types"
"types",
"index.mjs"
],
"type": "commonjs",
"scripts": {
Expand All @@ -30,7 +41,7 @@
"build:lib": "tsc -p .",
"changelog": "auto-changelog -p --commit-limit false --output HISTORY.md",
"coverage": "cross-env NODE_ENV=development nyc ./node_modules/.bin/mocha --recursive --bail --inline-diffs --reporter spec --check-leaks --use_strict $(find . -type f -name '*.spec.js' ! -path './nyc_output/*' ! -path './coverage/*' ! -path './node_modules/*')",
"lint": "eslint --fix lib/*.ts *.md *.json test/*.js test/*.spec.js",
"lint": "eslint --fix lib/*.ts *.md *.json test/*.js test/*.spec.js index.mjs",
"prepack": "yarn run build:lib",
"test": "yarn run build:lib && yarn run lint && yarn run coverage",
"test:opensslv3.0.1": "yarn run build > openssl_v3.0.1.log && yarn run test >> openssl_v3.0.1.log",
Expand Down
64 changes: 64 additions & 0 deletions test/esm.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
'use strict'

var fs = require('fs')
var pemCJS = require('pem')
var pemHelper = require('../lib/helper.js')
var hlp = require('./pem.helper.js')
var chai = require('chai')
var dirtyChai = require('dirty-chai')
var expect = chai.expect
chai.use(dirtyChai)

describe('ESM interop', function () {
after(function (done) {
var tmpfiles = [
'./test/fixtures/tmp.esm.der',
'./test/fixtures/tmp.esm.pem'
]
pemHelper.deleteTempFiles(tmpfiles, function (fsErr) {
hlp.checkError(fsErr)
done()
})
})

it('exposes the full public surface through import()', async function () {
// eslint-disable-next-line import/no-unresolved -- self-reference via the exports map; eslint's resolver cannot resolve a package by its own name
const esm = await import('pem')
expect(esm.default).to.equal(pemCJS)
const keys = Object.keys(pemCJS).sort()
for (const key of keys) {
expect(esm[key], 'named export ' + key).to.equal(pemCJS[key])
}
expect(Object.keys(esm).filter(function (k) { return k !== 'default' }).sort()).to.deep.equal(keys)
})

it('converts PEM to DER and back through the ESM entry', async function () {
// eslint-disable-next-line import/no-unresolved -- self-reference via the exports map; eslint's resolver cannot resolve a package by its own name
const { convert } = await import('pem')
const pemPath = './test/fixtures/nopkey.pem'
const pemString = fs.readFileSync(pemPath, 'utf8')
const der = await new Promise(function (resolve, reject) {
convert.PEM2DER(pemPath, './test/fixtures/tmp.esm.der', function (error, result) {
if (error) {
reject(error)
} else {
resolve(result)
}
})
})
expect(der).to.be.true()
// probed on this repo: PEM2DER(nopkey.pem) is byte-identical to the committed DER fixture
expect(fs.readFileSync('./test/fixtures/tmp.esm.der').equals(fs.readFileSync('./test/fixtures/nopkey.der'))).to.be.true()
const back = await new Promise(function (resolve, reject) {
convert.DER2PEM('./test/fixtures/tmp.esm.der', './test/fixtures/tmp.esm.pem', function (error, result) {
if (error) {
reject(error)
} else {
resolve(result)
}
})
})
expect(back).to.be.true()
expect(fs.readFileSync('./test/fixtures/tmp.esm.pem', 'utf8')).to.equal(pemString)
})
})
Loading