# leor-lotr

> A JavaScript SDK for the Lord of the rings API

Latest version **1.0.2** (published 2022-09-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install leor-lotr
pnpm add leor-lotr
yarn add leor-lotr
bun add leor-lotr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-09-20 |
| First published | 2022-09-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 95.5 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | liorehrlich |

## Links

- npm: https://www.npmjs.com/package/leor-lotr
- Repository: https://github.com/liorEhrlich/lord-of-the-rings-sdk
- Homepage: https://github.com/liorEhrlich/lord-of-the-rings-sdk#readme
- Issues: https://github.com/liorEhrlich/lord-of-the-rings-sdk/issues
- npm.io page: https://npm.io/package/leor-lotr

## Dependencies (3)

- [jest](https://npm.io/package/jest.md) ^27.5.1
- [axios](https://npm.io/package/axios.md) ^0.27.2
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.2

## Recent versions

- 1.0.2 (latest) — 2022-09-20
- 1.0.1 — 2022-09-20
- 1.0.0 — 2022-09-20

## README

<h1 align="center">💍 Lord of the Rings SDK</h1>
  
<br />

# 💡 What is Lord of the Rings SDK?

This project is an SDK over the [Lord of the rings API V2](https://the-one-api.dev/).

<br />

# 🤸 Getting Started

## 💾 Installation
Install leor-lotr via [npm](https://www.npmjs.com/package/leor-lotr):

```shell
npm i leor-lotr
```

## 🏇 First run

First we create a new instance of the exported class. This instance will have all the methods for fetching current data on LOTR.

```javascript
const LOTRClient = require("leor-lotr");
const client = new LOTRClient("API_KEY");

const getAllLOTRBooks = async () => {
  const books = await client.books.get();
  console.log("These are all the LOTR books: ", books);
};

getAllLOTRBooks();
```

<br />


 # 🧪 Tests

```shell

npm run test

```

<br />


 # 📚 Supported features
 
 ## The available routes
 
Method  | Response
------------- | -------------
``` books.get() ```  | List of all "The Lord of the Rings" books
``` books.get({id: ID}) ``` | Request one specific book
``` books.get({id: ID, include_child: true}) ``` | Request all chapters of one specific book
``` movies.get() ```  | List of all movies, including the "The Lord of the Rings" and the "The Hobbit" trilogies
``` movies.get({id: ID}) ``` | Request one specific movie
``` movies.get({id: ID, include_child: true}) ``` | Request all movie quotes for one specific movie (only working for the LotR trilogy)
``` characters.get() ```  | List of characters including metadata like name, gender, realm, race and more
``` characters.get({id: ID}) ``` | Request one specific character
``` characters.get({id: ID, include_child: true}) ``` | Request all movie quotes of one specific character
``` quote.get() ```  | List of all movie quotes
``` quote.get({id: ID}) ``` | Request one specific movie quote
``` chapter.get() ```  | List of all book chapters
``` chapter.get({id: ID}) ``` | Request one specific book chapter

 ## Pagination
 
Method  | Response
------------- | -------------
``` books.get({ limit: 1 }) ```  | Limit number of results
``` books.get({ offset: 1 }) ```  | Get results with offset
``` books.get({ page: 1 }) ```  | Get first page of results

## Sorting
 
Method  | Response
------------- | -------------
``` books.get({ sort: {field: string, dir: 'asc'|'desc' } }) ```  | Sort by field in ascending or descending order
  
<br />

# 🗺 Roadmap

This is Lord of the rings SDK at its first version. There are still many features ahead.
You can stay update with our roadmap in this [Trello board](https://trello.com/b/b2asakZV/lord-of-the-rings-sdk)

---
_Source: https://npm.io/package/leor-lotr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
