@sacquer/omdb-api
Advanced tools
Comparing version 0.0.5 to 0.0.6
14
index.js
@@ -13,2 +13,16 @@ const axios = require('axios') | ||
async search(parameters) { | ||
try { | ||
const { data } = await axios({ | ||
method: GET, | ||
url: URL, | ||
params: { apikey: this.apiKey, ...parameters }, | ||
}) | ||
return data | ||
} catch (error) { | ||
console.log(error.response) | ||
throw error.response.data | ||
} | ||
} | ||
async get(parameters) { | ||
@@ -15,0 +29,0 @@ try { |
{ | ||
"name": "@sacquer/omdb-api", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "axios": "^0.24.0" |
@@ -9,2 +9,10 @@ ### API for Open Movie Database | ||
omdb.search({ s: "Succession", type: "series", y: "2018" }) | ||
.then(result => console.log(result)) | ||
.catch(error => console.log(error) | ||
omdb.get({ t: 'Succession', type: "series", y: "2018", plot: "full" }) | ||
.then((result) => console.log(result) ) | ||
.catch((error) => console.log({ error }) ) | ||
omdb.getSeriesByTitle('Title of series') | ||
@@ -11,0 +19,0 @@ .then((result) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2583
63
34