@sacquer/omdb-api
Advanced tools
Comparing version 0.0.2 to 0.0.3
27
index.js
@@ -1,10 +0,23 @@ | ||
const value = 42 | ||
const axios = require('axios') | ||
function sum(a, b) { | ||
return a + b | ||
class OpenMovieDatabase { | ||
constructor(apiKey) { | ||
this.apiKey = apiKey | ||
} | ||
async get(parameters) { | ||
try { | ||
const { data } = await axios({ | ||
method: 'GET', | ||
url: 'http://www.omdbapi.com', | ||
params: { apikey: this.apiKey, ...parameters }, | ||
}) | ||
return data | ||
} catch (error) { | ||
console.log(error.response) | ||
throw error.response.data | ||
} | ||
} | ||
} | ||
module.exports = { | ||
value, | ||
sum | ||
} | ||
module.exports = OpenMovieDatabase |
{ | ||
"name": "@sacquer/omdb-api", | ||
"version": "0.0.2" | ||
"version": "0.0.3", | ||
"dependencies": { | ||
"axios": "^0.24.0" | ||
} | ||
} |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
570
20
0
1
+ Addedaxios@^0.24.0
+ Addedaxios@0.24.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)