Get IMDB ID from Movie Title
Current stable release: 2.x
yarn: yarn add imdb-id
npm: npm install --save imdb-id
const imdbId = require('../index.js');
The function takes a movie title as parameter:
await imdbId("H2G2")
const imdbId = require('../index.js');
(async () => {
const movieTitle = 'H2G2'
try {
const id = await imdbId(movieTitle);
console.log(`The IMDB Id of ${movieTitle} is ${id}`)
} catch (e) {
console.error('Error :', e)
}
})();