Skip to content

Commit 10214d9

Browse files
authored
docs(readme): examples use ESM (#609)
1 parent 517fd98 commit 10214d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const result = await requestWithAuth("GET /user");
164164
For more complex authentication strategies such as GitHub Apps or Basic, we recommend the according authentication library exported by [`@octokit/auth`](https://github.com/octokit/auth.js).
165165

166166
```js
167-
const { createAppAuth } = require("@octokit/auth-app");
167+
import { createAppAuth } from "@octokit/auth-app";
168168
const auth = createAppAuth({
169169
appId: process.env.APP_ID,
170170
privateKey: process.env.PRIVATE_KEY,
@@ -417,7 +417,8 @@ If the error is due to an `AbortSignal` being used, the resulting `AbortError` i
417417
Override or set default options. Example:
418418

419419
```js
420-
const myrequest = require("@octokit/request").defaults({
420+
import { request } from "@octokit/request";
421+
const myrequest = request.defaults({
421422
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
422423
headers: {
423424
"user-agent": "myApp/1.2.3",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy