Skip to content

Latest commit

 

History

History
105 lines (72 loc) · 1.82 KB

README.md

File metadata and controls

105 lines (72 loc) · 1.82 KB

o!rdr.js

GitHub stars

npm

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
  • Run npm install ordr.js

Documentation

Example usage

API

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:

const client = new Client("API_KEY");

Sending a replay

You can send a replay by doing the following:

client.sendRender({
    ...
    replay: "https://domain.tld/path/to/your/file.osr",
    ...
})
client.sendRender({
    ...
    replay: "path/to/your/file.osr",
    ...
})
const file = readFile("path/to/your/file.osr");
client.sendRender({
    ...
    replay: file,
    ...
})
const file = createReadStream("path/to/your/file.osr");
client.sendRender({
    ...
    replay: file,
    ...
})

WebSocket

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

Credits

Copyright

See the license