@octokit/webhooks 13.0.0-beta.3 → 13.0.0-beta.5

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.
Files changed (2) hide show
  1. package/README.md +7 -6
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -43,7 +43,8 @@ Note that while setting a secret is optional on GitHub, it is required to be set
43
43
 
44
44
  ```js
45
45
  // install with: npm install @octokit/webhooks
46
- const { Webhooks, createNodeMiddleware } = require("@octokit/webhooks");
46
+ import { Webhooks, createNodeMiddleware } from "@octokit/webhooks";
47
+ import { createServer } from "node:http";
47
48
  const webhooks = new Webhooks({
48
49
  secret: "mysecret",
49
50
  });
@@ -52,7 +53,7 @@ webhooks.onAny(({ id, name, payload }) => {
52
53
  console.log(name, "event received");
53
54
  });
54
55
 
55
- require("http").createServer(createNodeMiddleware(webhooks)).listen(3000);
56
+ createServer(createNodeMiddleware(webhooks)).listen(3000);
56
57
  // can now receive webhook events at /api/github/webhooks
57
58
  ```
58
59
 
@@ -81,7 +82,7 @@ source.onmessage = (event) => {
81
82
  };
82
83
  ```
83
84
 
84
- `EventSource` is a native browser API and can be polyfilled for browsers that don’t support it. In node, you can use the [`eventsource`](https://github.com/EventSource/eventsource) package: install with `npm install eventsource`, then `const EventSource = require('eventsource')`
85
+ `EventSource` is a native browser API and can be polyfilled for browsers that don’t support it. In node, you can use the [`eventsource`](https://github.com/EventSource/eventsource) package: install with `npm install eventsource`, then `import EventSource from "eventsource";)`
85
86
 
86
87
  ## API
87
88
 
@@ -278,7 +279,7 @@ Additionally, if verification fails, rejects the returned promise and emits an `
278
279
  Example
279
280
 
280
281
  ```js
281
- const { Webhooks } = require("@octokit/webhooks");
282
+ import { Webhooks } from "@octokit/webhooks";
282
283
  const webhooks = new Webhooks({
283
284
  secret: "mysecret",
284
285
  });
@@ -509,8 +510,8 @@ The `.removeListener()` method belongs to the `event-handler` module which can b
509
510
  ### createNodeMiddleware()
510
511
 
511
512
  ```js
512
- const { createServer } = require("http");
513
- const { Webhooks, createNodeMiddleware } = require("@octokit/webhooks");
513
+ import { createServer } from "node:http";
514
+ import { Webhooks, createNodeMiddleware } from "@octokit/webhooks";
514
515
 
515
516
  const webhooks = new Webhooks({
516
517
  secret: "mysecret",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octokit/webhooks",
3
- "version": "13.0.0-beta.3",
3
+ "version": "13.0.0-beta.5",
4
4
  "type": "module",
5
5
  "description": "GitHub webhook events toolset for Node.js",
6
6
  "keywords": [],
@@ -8,9 +8,9 @@
8
8
  "license": "MIT",
9
9
  "author": "Gregor Martynus (https://twitter.com/gr2m)",
10
10
  "dependencies": {
11
- "@octokit/request-error": "^5.0.0",
12
- "@octokit/webhooks-methods": "^4.0.0",
13
11
  "@octokit/openapi-webhooks-types": "5.3.2",
12
+ "@octokit/request-error": "^6.0.0",
13
+ "@octokit/webhooks-methods": "^5.0.0",
14
14
  "aggregate-error": "^5.0.0"
15
15
  },
16
16
  "devDependencies": {