gitea-js
v1.23.0
Published
[](https://www.npmjs.com/package/gitea-js) [](https://anbraten.github.io/gitea-js/) [ to make requests. For node you can use cross-fetch to polyfill the Fetch Api.
Version mapping
The major and minor version of this library is mapped to the version of the Gitea api. The patch version of this library is incremented for every release and uses the latest patch version of Gitea.
| Gitea-js | Gitea | | -------- | ----- | | 1.23.x | 1.23 | | 1.22.x | 1.22 | | 1.21.x | 1.21 | | 1.20.x | 1.20 | | 1.19.x | 1.19 | | 1.18.x | 1.18 | | 1.16.x | 1.17 | | < 1.2.0 | 1.17 |
Examples
Browser
import { giteaApi } from 'gitea-js';
const api = giteaApi('https://try.gitea.com/', {
token: 'access-token', // generate one at https://gitea.example.com/user/settings/applications
});
const repo = api.repos.repoGet('anbraten', 'gitea-js');
console.log(repo);Node.js
const { giteaApi } = require('gitea-js');
const fetch = require('cross-fetch'); // You have to use a fetch compatible polyfill like cross-fetch for Node.JS
const api = giteaApi('https://try.gitea.com/', {
token: 'access-token', // generate one at https://gitea.example.com/user/settings/applications
customFetch: fetch,
});
const repo = api.repos.repoGet('anbraten', 'gitea-js');
console.log(repo);