Socket
Socket
Sign inDemoInstall

@mharj/the-movie-database-client

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mharj/the-movie-database-client

The Movie Database API client


Version published
Weekly downloads
1
Maintainers
1
Install size
359 kB
Created
Weekly downloads
 

Readme

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

Last updated on 06 Aug 2023

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