Lightweight non official OMDb (Movie database) Typescript SDK
Contributions are more than welcome
# Using npm
$ npm install @thblt-thlgn/omdb
# Or using yarn
$ yarn add @thblt-thlgn/omdb
// Import in TypeScript
import OMDb from '@thblt-thlgn/omdb';
// Import in JavaScript
const { OMDb } = require('@thblt-thlgn/omdb');
// Create a new instance
const client = new OMDb('my_api_key'); // Check out http://www.omdbapi.com/apikey.aspx
// Search a movie
client.search('Onward')
.then(console.log)
.catch(console.error);
// Get a movie by its title
client.getByTitle('Shrek')
.then(console.log)
.catch(console.error);
// Get a movie by its IMDb ID
client.getById('tt2575988')
.then(console.log)
.catch(console.error);
$ env API_KEY=my_api_key yarn test