Movie.js
An advanced api wrapper for the OMDB API
Features:
- Lightweight - Only one dependency
- Object-oriented
- Promise and async/await support
- Easy-to use syntax
- Advanced error handling - Catch errors before you send them to the API
- 100% API support - The whole OMDB API is documented and covered
- High-level api - start hacking in just a few lines!
Installation
npm install movie.js
Usage
const movieJs = require("movie.js");
const movies = new movieJs(process.env.API_KEY);
Wrap the following code in an await function to use async/await. More info
Search for movies
await movies.search("Star Wars");
await movies.search("Star Wars", {
type: "",
year: 1999,
page: 1,
});
Get movie by IMDB ID
await movies.get("tt1285016");
await movies.get("tt1285016", {
plot : "full",
});
const movie = await movies.search("Star Wars");
await movies.get(movie[0]);
Get movie by title
await movies.getByTitle("Good Burger");
await movies.getByTitle("Good Burger", {
plot: "full",
type: "movie",
year: 1997,
});
Get movie poster
await movies.getPoster("tt1285016");
License
MIT