Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lockblock-dev/ordr.js
A TypeScript library for interacting with the o!rdr API and WebSocket
https://github.com/lockblock-dev/ordr.js
ordr osu osu-render osu-replay
Last synced: 28 days ago
JSON representation
A TypeScript library for interacting with the o!rdr API and WebSocket
- Host: GitHub
- URL: https://github.com/lockblock-dev/ordr.js
- Owner: LockBlock-dev
- License: mit
- Created: 2021-06-28T16:33:53.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-23T17:49:31.000Z (9 months ago)
- Last Synced: 2024-04-24T00:30:04.678Z (8 months ago)
- Topics: ordr, osu, osu-render, osu-replay
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/ordr.js
- Size: 107 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# o!rdr.js
[![GitHub stars](https://img.shields.io/github/stars/LockBlock-dev/ordr.js.svg)](https://github.com/LockBlock-dev/ordr.js/stargazers)
[![npm](https://img.shields.io/npm/dm/ordr.js)](https://www.npmjs.com/package/ordr.js)
ordr.js is a Node.js module that allows you to easily interact with the o!rdr API and WebSocket.
- Promise-based
- Performant
- 100% coverage of the o!rdr API and WebSocket## Installation
- Install [NodeJS](https://nodejs.org)
- Run `npm install ordr.js`## Documentation
- [Documentation](/docs/modules/client.md)
- [WebSocket events](/docs/enums/types_ws.WebSocketEvents.md)
- [Changelog](/CHANGELOG.md)## Example usage
### API
```js
import { Client } from "ordr.js";const client = new Client();
const skins = await client.getSkins();
console.log(skins);
```### API key
If you have an API key, you can specify it when initiating the client:
```js
const client = new Client("API_KEY");
```### Sending a replay
You can send a replay by doing the following:
```js
client.sendRender({
...
replay: "https://domain.tld/path/to/your/file.osr",
...
})
``````js
client.sendRender({
...
replay: "path/to/your/file.osr",
...
})
``````js
const file = readFile("path/to/your/file.osr");
client.sendRender({
...
replay: file,
...
})
``````js
const file = createReadStream("path/to/your/file.osr");
client.sendRender({
...
replay: file,
...
})
```### WebSocket
```js
import { Client, Events } from "ordr.js";const client = new Client();
client.on(Events.Connected, () => console.log("Client connected!"));
client.start();
```List of events available [here](/docs/enums/types_ws.WebSocketEvents.md)
## Credits
- [o!rdr API](https://ordr.issou.best/docs)
- [flazepe](https://github.com/flazepe)## Copyright
See the [license](/LICENSE)