Skip to content

Commit 7ed7bf1

Browse files
Uzlopakdgellowwolfy1339
authored
v2.0.0 (#131)
BREAKING CHANGE: This package is now ESM only. * feat: add support for PKCS8 keys (#129) Co-authored-by: Samuel El-Borai <sam@elborai.me> * chore: modernize and migrate to esm (#127) Co-authored-by: wolfy1339 <4595477+wolfy1339@users.noreply.github.com> --------- Co-authored-by: Samuel El-Borai <sam@elborai.me> Co-authored-by: wolfy1339 <4595477+wolfy1339@users.noreply.github.com>
1 parent eec780a commit 7ed7bf1

10 files changed

Lines changed: 4020 additions & 7376 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
node_version:
1717
- 18
1818
- 20
19+
- 22
1920
steps:
2021
- uses: actions/checkout@v4
2122
- name: Use Node.js ${{ matrix.node_version }}

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Finds a private key through various user-(un)specified methods. Order of precede
1212
3. `PRIVATE_KEY_PATH` environment variable or explicit `env.PRIVATE_KEY_PATH` option
1313
4. Any file w/ `.pem` extension in current working dir
1414

15+
Supports both PKCS1 (i.e `-----BEGIN RSA PRIVATE KEY-----`) and PKCS8 (i.e `-----BEGIN PRIVATE KEY-----`).
16+
1517
## Usage
1618

1719
<table>
@@ -30,10 +32,16 @@ Node
3032
Install with <code>npm install @probot/get-private-key</code>
3133

3234
```js
33-
const { Probot } = require("probot");
34-
const { getPrivateKey } = require("@probot/get-private-key");
35+
import { Probot } from "probot";
36+
import { getPrivateKey } from "@probot/get-private-key";
3537
```
3638

39+
> [!IMPORTANT]
40+
> As we use [conditional exports](https://nodejs.org/api/packages.html#conditional-exports), you will need to adapt your `tsconfig.json` by setting `"moduleResolution": "node16", "module": "node16"`.
41+
>
42+
> See the TypeScript docs on [package.json "exports"](https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports).<br>
43+
> See this [helpful guide on transitioning to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) from [@sindresorhus](https://github.com/sindresorhus)
44+
3745
</td></tr>
3846
</tbody>
3947
</table>

0 commit comments

Comments
 (0)