Socket
Socket
Sign inDemoInstall

movie.js

Package Overview
Dependencies
2
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    movie.js

Get information for the OMDB API


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 09 Dec 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc