Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mharj/the-movie-database-client

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mharj/the-movie-database-client

The Movie Database API client

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@mharj/the-movie-database-client

This is a limited client for The Movie Database API.
Currently only the v3 API is supported for the following methods:

  • Query Movies: searchMovies
  • Query TV Shows: searchTvShows
  • Get Movie Details: getMovieDetails
  • Get TV Show Details: getTvShowDetails

All methods are using Rust style Result type to indicate success or failure. (or use .unwrap() to get the value or throw an error)

Installation

npm install @mharj/the-movie-database-client

Usage

import {TheMovieDatabaseV3} from '@mharj/the-movie-database-client';

const client = new TheMovieDatabaseV3('your-api-key'); // key can be value, Promised value or a function that returns either

const movieSearchList: MovieSearchV3Response = (await client.searchMovies({query: 'James Bond'})).unwrap();

const movieDetails: MovieDetailV3Response = (await client.getMovieDetails(movieSearchList.results[0].id)).unwrap();

const tvSearchList: TvShowSearchV3Response = (await client.searchTvShows({query: 'Ring'})).unwrap();

const tvDetails: TvShowDetailV3Response = (await client.getTvShowDetails(tvSearchList.results[0].id)).unwrap();

Keywords

FAQs

Package last updated on 06 Aug 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc