New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

lor-data-dragon

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lor-data-dragon

Interface for accessing the Legends of Runeterra Data Dragon

latest
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

RuneterraDataDragon

This is a small package for providing a JavaScript/TypeScript API for the Runeterra Data Dragon, which is a static database of Runeterra card and image data. Please note that this package only works in node.js environments, and will not work in the browser (sorry, I tried!)

Features

  • Detailed TypeScript types
  • Caching layer to ensure you don't download duplicate files
  • Async API
  • Support for different locales and data versions
  • Automatically tested

Installation

npm install lor-data-dragon

Usage

import * as rune from "lor-data-dragon";

// Instantiate a client
const dd = new rune.DataDragon({
    cacheDir: "./testCache"
});

// Access to the per-set data
const setBundle = await dd.getLiteSetBundle(rune.Set.BeyondTheBandlewood, rune.Locale.English);
const cards: rune.Card[] = await setBundle.getCards();
const cardImage: Buffer = await setBundle.getCardImage(cards[0].cardCode)

// Access to the global game data
const bundle = await dd.getCoreBundle(rune.Locale.English);
const global: rune.GlobalData = await bundle.getGlobalData();
const regionImage: Buffer = await bundle.getRegionImage("bilgewater");

Additional methods and parameters are fully documented, and the use of TypeScript is strongly recommended to autocomplete all of these.

Changelog

2.0.0

  • Export renaming. You are now encouraged to import * as rune from "lor-data-dragon"; namespace the exports sensibly
    • LorDataDragon renamed to DataDragon
    • RuneterraSet renamed to Set
  • Reworked interface:
    • The DataDragon now returns wrapper objects which themselves can be used to fetch card/image data

FAQs

Package last updated on 05 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts