Socket
Socket
Sign inDemoInstall

v3-yelp-api

Package Overview
Dependencies
4
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

15

index.js

@@ -1,2 +0,3 @@

import http from 'httpism';
import http from 'axios';
import qs from 'querystring'

@@ -18,6 +19,5 @@ const baseUrl = 'https://api.yelp.com/v3/';

if(this.accessToken) Promise.resolve(this.accessToken)
return http.post(tokenUrl, this.credentials , {form: true})
.then((res) => {this.accessToken = res.body.access_token; return this.accessToken})
.catch(err => new Error(err.message))
}
return http.post(tokenUrl, qs.stringify(this.credentials) )
.then((res) => { this.accessToken = res.data.access_token;return this.accessToken})
}

@@ -27,5 +27,4 @@ get(resource,params){

return this.getAccessToken()
.then(token => http.get(baseUrl + resource ,{ querystring:params, headers: {'Authorization': 'Bearer ' + token}}))
.then(res => res.body)
.catch(err => new Error(err.message))
.then(token => http({method:'get' ,url:baseUrl + resource, params:params, headers: {'Authorization': 'Bearer ' + token}}))
.then(res => res.data)
}

@@ -32,0 +31,0 @@

{
"name": "v3-yelp-api",
"version": "1.0.1",
"version": "1.0.2",
"description": "Node Wrapper for Yelp Api V3",

@@ -25,4 +25,5 @@ "main": "index.js",

"dependencies": {
"httpism": "^2.7.0"
"axios": "^0.16.1",
"querystring": "^0.2.0"
}
}

@@ -1,4 +0,7 @@

# v3 Yelp Api Wrapper
A simple npm wrapper for Yelp v3 Api
# v3 Yelp Api
A simple npm wrapper for Yelp v3 Api which is compatible with [React Native](https://github.com/facebook/react-native)
## Dependencies
[axios](https://github.com/mzabriskie/axios)
[qs](https://github.com/ljharb/qs)
## Install

@@ -13,3 +16,3 @@

let credententials = {
const credentials = {
appId:"App Id from Yelp Developer Console",

@@ -19,3 +22,3 @@ app: "App Secret from Yelp Developer Console"

let yelp = New YelpApi(credentials)
const yelp = New YelpApi(credentials)
```

@@ -38,5 +41,3 @@

```JavaScript
let params = {
phone: '+442073722882'
}
let params = { phone: '+442073722882' }

@@ -55,3 +56,3 @@ yelp.phoneSearch(params)

yelp.reviews(bestRestaurantEver)
yelp.reviews(bestRestaurantEver)
.then(data => data)

@@ -58,0 +59,0 @@ .catch(err => err)

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc