# @cordis/rest

> Cordis' REST utilities for the Discord API

Latest version **1.2.0** (published 2021-11-24) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @cordis/rest
pnpm add @cordis/rest
yarn add @cordis/rest
bun add @cordis/rest
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2021-11-24 |
| First published | 2021-02-24 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 22.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Maintainers | didinele |

## Links

- npm: https://www.npmjs.com/package/@cordis/rest
- Repository: https://github.com/cordis-lib/cordis
- Homepage: https://github.com/cordis-lib/cordis#readme
- Issues: https://github.com/cordis-lib/cordis/issues
- npm.io page: https://npm.io/package/@cordis/rest

## Dependencies (7)

- [tslib](https://npm.io/package/tslib.md) ^2.3.1
- [form-data](https://npm.io/package/form-data.md) ^3.0.1
- [node-fetch](https://npm.io/package/node-fetch.md) 3.0.0-beta.9
- [@cordis/error](https://npm.io/package/@cordis/error.md) ^1.2.0
- [@cordis/common](https://npm.io/package/@cordis/common.md) ^1.2.0
- [abort-controller](https://npm.io/package/abort-controller.md) ^3.0.0
- [discord-api-types](https://npm.io/package/discord-api-types.md) ^0.24.0

## Recent versions

- 1.2.0 (latest) — 2021-11-24
- 2.0.0-next.2405c88.1643469558 (next) — 2022-01-29
- 2.0.0-next.f84cd8a.1643462997 — 2022-01-29
- 2.0.0 — 2022-01-29
- 2.0.0-next.fcc728d.1642936722 — 2022-01-23
- 2.0.0-next.c972fcf.1642877601 — 2022-01-22
- 2.0.0-next.c972fcf.1642875008 — 2022-01-22
- 2.0.0-next.01aa775.1642870608 — 2022-01-22
- 2.0.0-next.7e0063f.1642867210 — 2022-01-22
- 2.0.0-next.e94b5ff.1642794065 — 2022-01-21
- 2.0.0-next.75dec7f.1642793961 — 2022-01-21
- 2.0.0-next.560dbb7.1642791649 — 2022-01-21
- 1.2.0-next.db7a550.1642699458 — 2022-01-20
- 1.2.0-next.db7a550.1642699311 — 2022-01-20
- 1.2.0-next.1336a5a.1642698949 — 2022-01-20
- … 23 more at https://npm.io/package/@cordis/rest/versions

## README

# `@cordis/rest`  

[![GitHub](https://img.shields.io/badge/License-Apache%202.0-yellow.svg)](https://github.com/cordis-lib/cordis/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/v/@cordis/rest?color=crimson&logo=npm)](https://www.npmjs.com/package/@cordis/rest)
[![TypeScript](https://github.com/cordis-lib/cordis/actions/workflows/quality.yml/badge.svg)](https://github.com/cordis-lib/cordis/actions/workflows/quality.yml)

Cordis' REST utilities for the Discord API

Note: Props to https://github.com/spec-tacles/spectacles.js for the Mutex logic.

## Installation
- `npm install @cordis/rest` 
- `pnpm install @cordis/rest` 
- `yarn add @cordis/rest`

## Example Usage
```ts
const { Rest, buildRestRouter } = require('@cordis/rest');

const main = async () => {
  const rest = new Rest('token');
  const router = buildRestRouter(rest);

  // using the rest manager itself
  const someUser = await rest.get('/users/223703707118731264');
  const someOtherUser = await rest.make({
    path: '/users/198536269586890752',
    method: 'get'
  });

  // using the router utility
  const someOtherOtherUser = await router.users["223703707118731264"].get();

  console.log(someUser, someOtherUser, someOtherOtherUser);
};

main();
```

## Documentation
You can find documentation for the whole project over at https://cordis.js.org

## Contributing
Please see the main [README.md](https://github.com/cordis-lib/cordis) for info on how to contribute to this package or the other `@cordis` packages.

## LICENSE
Licensed under the [Apache 2.0](https://github.com/cordis-lib/cordis/blob/main/LICENSE) license.

---
_Source: https://npm.io/package/@cordis/rest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
