New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sacquer/omdb-api

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sacquer/omdb-api - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

37

index.js
const axios = require('axios')
const GET = 'GET'
const SERIES = 'series'
const MOVIE = 'movie'
const URL = 'http://www.omdbapi.com'
class OpenMovieDatabase {

@@ -11,4 +16,4 @@ constructor(apiKey) {

const { data } = await axios({
method: 'GET',
url: 'http://www.omdbapi.com',
method: GET,
url: URL,
params: { apikey: this.apiKey, ...parameters },

@@ -22,4 +27,32 @@ })

}
async getSeriesByTitle(title) {
try {
const { data } = await axios({
method: GET,
url: URL,
params: { apikey: this.apiKey, t: title, type: SERIES },
})
return data
} catch (error) {
console.log(error.response)
throw error.response.data
}
}
async getMovieByTitle(title) {
try {
const { data } = await axios({
method: GET,
url: URL,
params: { apikey: this.apiKey, t: title, type: MOVIE },
})
return data
} catch (error) {
console.log(error.response)
throw error.response.data
}
}
}
module.exports = OpenMovieDatabase

2

package.json
{
"name": "@sacquer/omdb-api",
"version": "0.0.4",
"version": "0.0.5",
"dependencies": {

@@ -5,0 +5,0 @@ "axios": "^0.24.0"

@@ -6,6 +6,6 @@ ### API for Open Movie Database

```js
const OpenMovieDatabase = require('@sacquer/open-movie-database')
const OpenMovieDatabase = require('@sacquer/omdb-api)
const omdb = new OpenMovieDatabase('your-api-key')
omdb.get({ t: 'Title of movie' })
omdb.getSeriesByTitle('Title of series')
.then((result) => {

@@ -17,2 +17,11 @@ console.log(result)

})
omdb.getMovieByTitle('Title of movie')
.then((result) => {
console.log(result)
})
.catch((error) => {
console.log(error)
})
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc