3.3.5 • Published 2 years ago

movie.js v3.3.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Movie.js

NPM downloads License Vulnerabilities

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); // API key goes here

Wrap the following code in an await function to use async/await. More info

Search for movies

await movies.search("Star Wars"); // Search for star wars movies

await movies.search("Star Wars", { // Search with options
	type: "", // Either movie, series, or episode
	year: 1999, // Shows search results of movies released that year 
	page: 1, // Pagination 1-100
}); 

Get movie by IMDB ID

await movies.get("tt1285016"); // Get movie by ID

await movies.get("tt1285016", { // Get movie by ID with options
	plot : "full", // Whether to return a "short" or "full" plot
});

const movie = await movies.search("Star Wars"); // Search for a movie
await movies.get(movie[0]); // Get more info on the first movie

Get movie by title

await movies.getByTitle("Good Burger"); // Get movie by title

await movies.getByTitle("Good Burger", {
	plot: "full", // Whether to return a "short" or "full" plot
	type: "movie", // Either movie, series, or episode
	year: 1997, // What year the returned movie should be
});

Get movie poster

await movies.getPoster("tt1285016"); // Get poster image as a buffer 

License

MIT

3.3.5

2 years ago

3.3.4

3 years ago

3.3.3

3 years ago

3.3.0

3 years ago

3.1.0

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.3.3

3 years ago

2.3.2

3 years ago

2.3.0

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.0.0

3 years ago

0.2.0

6 years ago