imdb id
ES6 - async
從電影標題取得 IMDB ID
目前穩定版本: 2.x
紗線: yarn add imdb-id
npm: npm install --save imdb-id
const imdbId = require('../index.js');
此函數採用電影標題作為參數:
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)
}
})();