UNPKG

1.96 kBMarkdownView Raw
1# rest.js
2
3> GitHub REST API client for JavaScript
4
5[![@latest](https://img.shields.io/npm/v/@octokit/rest.svg)](https://www.npmjs.com/package/@octokit/rest)
6[![Build Status](https://github.com/octokit/rest.js/workflows/Test/badge.svg)](https://github.com/octokit/rest.js/actions?query=workflow%3ATest+branch%3Amaster)
7
8## Usage
9
10<table>
11<tbody valign=top align=left>
12<tr><th>
13Browsers
14</th><td width=100%>
15Load <code>@octokit/rest</code> directly from <a href="https://cdn.skypack.dev">cdn.skypack.dev</a>
16
17```html
18<script type="module">
19import { Octokit } from "https://cdn.skypack.dev/@octokit/rest";
20</script>
21```
22
23</td></tr>
24<tr><th>
25Node
26</th><td>
27
28Install with <code>npm install @octokit/rest</code>
29
30```js
31const { Octokit } = require("@octokit/rest");
32// or: import { Octokit } from "@octokit/rest";
33```
34
35</td></tr>
36</tbody>
37</table>
38
39```js
40const octokit = new Octokit();
41
42// Compare: https://docs.github.com/en/rest/reference/repos/#list-organization-repositories
43octokit.rest.repos
44 .listForOrg({
45 org: "octokit",
46 type: "public",
47 })
48 .then(({ data }) => {
49 // handle data
50 });
51```
52
53See https://octokit.github.io/rest.js for full documentation.
54
55## Contributing
56
57We would love you to contribute to `@octokit/rest`, pull requests are very welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
58
59## Credits
60
61`@octokit/rest` was originally created as [`node-github`](https://www.npmjs.com/package/github) in 2012 by Mike de Boer from Cloud9 IDE, Inc. [The original commit](https://github.blog/2020-04-09-from-48k-lines-of-code-to-10-the-story-of-githubs-javascript-sdk/) is from 2010 which predates the npm registry.
62
63It was adopted and renamed by GitHub in 2017. Learn more about it's origin on GitHub's blog: [From 48k lines of code to 10—the story of GitHub’s JavaScript SDK](https://github.blog/2020-04-09-from-48k-lines-of-code-to-10-the-story-of-githubs-javascript-sdk/)
64
65## LICENSE
66
67[MIT](LICENSE)