1.0.2 • Published 12 months ago
@charles-dr/lord-of-rings v1.0.2
The Lord of the Rings SDK
Typescript SDK for The Lord of the Rings API
Access Token
Before using the SDK, you'll need to get an access token from https://the-one-api.dev.
Installation
Using npm:
$ npm install @charles-dr/lord-of-rings
Using yarn:
$ yarn add @charles-dr/lord-of-rings
Using pnpm:
$ pnpm add @charles-dr/lord-of-rings
Once the package is installed, you can import the library.
import LordOfRings from '@charles-dr/lord-of-rings';
or
import { LordOfRings } from '@charles-dr/lord-of-rings';
Usage
To get movies:
import LordOfRings from '@charles-dr/lord-of-rings';
const client = new LordOfRings("<YOUR ACCESS TOKEN>");
const movies = await client.movie.getAll();
// you can use the pagination also.
const movies = await client.movie.getAll(10, 5); // limit: 10, offset: 5
To get quotes:
const quotes = await client.quote.getAll();
// with pagination
const quotes = await client.quote.getAll(10, 5);