https://github.com/thblt-thlgn/omdb
Non official OMDb Typescript SDK
https://github.com/thblt-thlgn/omdb
nodejs omdb-api typescript
Last synced: 10 months ago
JSON representation
Non official OMDb Typescript SDK
- Host: GitHub
- URL: https://github.com/thblt-thlgn/omdb
- Owner: thblt-thlgn
- License: unlicense
- Created: 2020-05-16T21:51:51.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-26T17:36:22.000Z (about 4 years ago)
- Last Synced: 2025-06-17T02:40:24.922Z (about 1 year ago)
- Topics: nodejs, omdb-api, typescript
- Language: TypeScript
- Homepage: http://www.omdbapi.com/
- Size: 237 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OMDb Typescript SDK

[](https://badge.fury.io/js/%40thblt-thlgn%2Fomdb)
Lightweight non official [OMDb](http://www.omdbapi.com/) (Movie database) Typescript SDK
_Contributions are more than welcome_
## Install
```sh
# Using npm
$ npm install @thblt-thlgn/omdb
# Or using yarn
$ yarn add @thblt-thlgn/omdb
```
## How to use ?
```ts
// 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);
```
## Run tests
```sh
$ env API_KEY=my_api_key yarn test
```