0.4.0 • Published 2 years ago

artur_dani-sdk v0.4.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

The LotrSDK

An sdk for the The One API which is a RESTful API based on the works of J.R.R. Tolkien. The sdk is written in TypeScript and uses Axios for the http requests.

Installation

Install the package via npm(or your favorite package manager)

npm i artur_dani-sdk

Usage

You need to register here for an api key in order to use the sdk

Using this package with typescript is where the real power comes from. There is typing and overloading for nearly every method.

import { LotrSdk } from 'artur_dani-sdk'

const apiKey = process.env.API_KEY
const client = new LotrSdk(apiKey)

const book = await client.books.getOneById('id')
// or 
const books = await client.books.list()

Tests

Test are made with jest and you can run them like so

yarn test