Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

osrs-hiscores-parser

anarchytrex246MIT2.0.9TypeScript support: included

Package that parses and transforms Old School Runescape Hiscore API results into a JSON object.

Old School Runescape, OSRS, Runescape

readme

osrs-hiscores-parser

The purpose of this package is to parse and transform Old School Runescape Hiscore API results and return it as a JSON object.

Written entirely in TypeScript, it contains it's own type declarations.

Installation

yarn

yarn add osrs-hiscores-parser

npm

npm install osrs-hiscores-parser

Usage

*Usernames can be any case, lower, UPPER or MiXeD.

Base JS/TS

import { parser } from 'osrs-hiscores-parser'

(async function example() {
  const json = await parser(['echogim', 'lynx titan']);
  console.log(...json)
})()

React

import { parser } from 'osrs-hiscores-parser'

const [json, setJson] = React.useState<any[]>();
useEffect(() => {
  (async () => {
    !json && setJson(await parser(['echogim', 'emerald12']))
  })()
  console.log(json)
}, [json])