osrs-hiscores-parser
TypeScript icon, indicating that this package has built-in type declarations

2.0.9 • Public • Published

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])

Package Sidebar

Install

npm i osrs-hiscores-parser

Weekly Downloads

13

Version

2.0.9

License

MIT

Unpacked Size

26.8 kB

Total Files

15

Last publish

Collaborators

  • anarchytrex