Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
rett-behrens-lotr-sdk
Advanced tools
One API to rule them all - LibLab take home project - The Lord of the Rings SDK - NodeJS client
This SDK makes it easy for developers to consume information about the LOTR series via the LOTR API.
To install this SDK in your project:
npm install rett-behrens-lotr-sdk
The LOTR API rquires a valid access token in order to make API requests to the server. To obtain an access token sign up for a LOTR API user account. Upon sign up you will be presented with an access token. You can also revisit your account page to retrieve your access token at any time. Add the access token to your project evironment variables file so you can reference this key securely in your project code.
LOTR_TOKEN = "xxxxxxxuxxxxxxxxxx-x"
method | description |
---|---|
getMovies() | Returns a list of all movies, including the "The Lord of the Rings" and the "The Hobbit" trilogies |
getMovieById(id) | Returns the specified movie |
getQuotes() | Returns a list of all movie quotes |
getQuoteById(id) | Returns the specified quote |
getQuotesByMovieId(id) | Returns all movie quotes for one specific movie (only working for the LotR trilogy) |
require('dotenv').config()
const lotr = require('rett_behrens_lotr_sdk');
(async () => {
// instatiating API client
const moviesAPI = new lotr.MoviesApi()
const quotesAPI = new lotr.QuotesApi();
// setting your access token to the API client
moviesAPI.accessToken = process.env.LOTR_TOKEN;
quotesAPI.accessToken = process.env.LOTR_TOKEN;
// GET all movies
const movies = await moviesAPI.getMovies();
console.log(movies.body);
// quotes will only work for the LotR trilogy, so we're filtering here
const movieId = movies.body.docs.filter(movie => movie.name == 'The Fellowship of the Ring')[0].id;
console.log(movieId);
// GET a specific movie by ID
const movie = await moviesAPI.getMovieById(movieId);
console.log(movie.body);
// GET all quotes
const quotes = await quotesAPI.getQuotes();
console.log(quotes.body);
// In The Hobbit, the approximate distance traveled by Bilbo and his companions to Rivendell was 397 miles. It took them 38 days to get there.
// GET a specific quote by ID
const quote = await quotesAPI.getQuoteById(quotes.body.docs[397].id);
console.log(quote.body);
// GET quotes from specific movie
const quotesFromTFOTR = await quotesAPI.getQuotesByMovieId(movieId);
console.log(quotesFromTFOTR.body);
})();
FAQs
One API to rule them all - LibLab take home project - The Lord of the Rings SDK - NodeJS client
The npm package rett-behrens-lotr-sdk receives a total of 0 weekly downloads. As such, rett-behrens-lotr-sdk popularity was classified as not popular.
We found that rett-behrens-lotr-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.