Skip to content

A TypeScript library for interacting with the o!rdr API and WebSocket

License

Notifications You must be signed in to change notification settings

LockBlock-dev/ordr.js

Repository files navigation

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

About

A TypeScript library for interacting with the o!rdr API and WebSocket

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project