npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mishael_lotr_sdk

v1.0.7

Published

The Lord of the Rings SDK is a software development kit that provides easy access to the Lord of the Rings API. It simplifies the consumption of movie and quote data from the API, allowing developers to integrate Lord of the Rings content into their appli

Downloads

2

Readme

Lord of the Rings SDK

The Lord of the Rings SDK is a software development kit that provides easy access to the Lord of the Rings API. It simplifies the consumption of movie and quote data from the API, allowing developers to integrate Lord of the Rings content into their applications more efficiently. This SDK is written in TypeScript and can be used in any TypeScript or JavaScript project.

Features

  • Get All Movies
  • Get Movies By ID
  • Get Quotes for Movies
  • Get All Quotes
  • Get Quotes By ID

Installation

To use this SDK, you need to have Node.js and npm installed. This SDK supports Node.js version 12 and above

  1. First, install the mishael_lotr_sdk npm package:Run the following command: npm install mishael_lotr_sdk
  2. Create an .env file in your project directory and add your API key and the base URL: API_KEY=your-api-key BASE_URL=https://the-one-api.dev/v2

Usage

To use the Lord of the Rings SDK in your project, follow these steps:

  1. Import the LordOfTheRingsSDK class in your code:

    import { LordOfTheRingsSDK } from "mishael_lotr_sdk/src";

  2. Create an instance of LordOfTheRingsSDK :

    const sdk = new LordOfTheRingsSDK(apiKey); Note: You need to get the apikey from https://the-one-api.dev/ to initialise the library

  3. Use the movie and quote properties to access the available API methods like: const movies = await sdk.movie.getAllMovies(); , const movie = await sdk.movie.getMovieById(movieId); , const quotes = await sdk.quote.getAllQuotes(); , const quotesforMovie = await sdk.quote.getQuotesForMovie(movieId); , const quotesbyId = await sdk.quote.getQuoteById(quoteId);

  4. Handle the returned data or any potential errors.

API Methods

The Lord of the Rings SDK provides the following API methods:

Movie API

  • getAllMovies(): Retrieves all movies.
  • getMovieById(id: string): Retrieves a specific movie by ID.

Quote API

  • getAllQuotes(): Retrieves all quotes.
  • getQuotesForMovie(movieId: string): Retrieves quotes for a specific movie.
  • getQuoteById(id: string): Retrieves a specific quote by ID.

Authentication

Authentication or an API key is not required to access some of the endpoints of the Lord of the Rings API like /books and /book/{id} . However, with other endpoints, like /movie , /movie/{id}, /movie/{id}/quote , /quote , /quote/{id} , the API enforces authentication. Hence, an API key is provided during the initialisation of the LordOfTheRingsSDK instance:

const apiKey = 'YOUR_API_KEY';
const sdk = new LordOfTheRingsSDK(apiKey);

Make sure to obtain a valid API key from the Lord of the Rings API, as the authentication is required.

NOTE: There's a popular error that is gotten due to the fact that access for authenticated users to all endpoints of the lord of the rings API being limited to 100 requests every 10 minutes. This is shown below:

enter image description here

Example

You can find more examples in the example.ts file in this repository. These examples demonstrate how to use different SDK methods to interact with the Lord of the Rings API.

Contributing

Contributions to the Lord of the Rings SDK are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue on the GitHub repository.