Lord of the Rings SDK
Installation
Use npm to install the SDK:
npm install --save @helderjbe/lotr-sdk
Or if you prefer yarn:
yarn add @helderjbe/lotr-sdk
Quick start
import { getAllMovies, getQuoteById } from '@helderjbe/lotr-sdk';
// Set the access token for authentication
const ACCESS_TOKEN = 'your_access_token_here';
// Fetch all movies
const movies = await getAllMovies(ACCESS_TOKEN);
console.log(movies); // array of movies
// Fetch a specific quote
const quote = await getQuoteById(ACCESS_TOKEN, 'quote_id');
console.log(quote); // quote object
Testing
To run tests, you will need to clone the repository and install the dependencies.
Clone the repository:
git clone https://github.com/hatchways-community/b69b28ddbed643f88b72f173a88d19ab.git
cd b69b28ddbed643f88b72f173a88d19ab
Install dependencies:
npm install
Now, run the test script:
npm test
Troubleshooting
If an error pops up when installing deps with npm i
, try installing with npm i -f