unsplash-js
Advanced tools
Comparing version 3.0.0 to 3.1.0
{ | ||
"name": "unsplash-js", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "A Universal JavaScript wrapper for the Unsplash API", | ||
@@ -5,0 +5,0 @@ "main": "lib/unsplash.js", |
@@ -73,3 +73,3 @@ # Unsplash | ||
```js | ||
let authenticationUrl = unsplash.auth.getAuthenticationUrl([ | ||
const authenticationUrl = unsplash.auth.getAuthenticationUrl([ | ||
"public", | ||
@@ -137,3 +137,3 @@ "read_user", | ||
```js | ||
let authenticationUrl = unsplash.auth.getAuthenticationUrl([ | ||
const authenticationUrl = unsplash.auth.getAuthenticationUrl([ | ||
"public", | ||
@@ -294,2 +294,23 @@ "read_user", | ||
### users.collections(username, page, perPage) | ||
Get a list of collections created by the user. | ||
__Arguments__ | ||
| Argument | Type | Opt/Required | Notes | | ||
|---|---|---|---| | ||
|__`username`__|_string_|Required|| | ||
|__`page`__|_number_|Optional|| | ||
|__`perPage`__|_number_|Optional|| | ||
__Example__ | ||
```js | ||
unsplash.users.collections("naoufal", 2, 15) | ||
.then(toJson) | ||
.then(json => { | ||
// Your code | ||
}); | ||
``` | ||
--- | ||
<div id="photos" /> | ||
@@ -766,3 +787,3 @@ | ||
let unsplash = new Unsplash({ | ||
const unsplash = new Unsplash({ | ||
applicationId: "{YOUR_APPLICATION_ID}", | ||
@@ -769,0 +790,0 @@ secret: "{YOUR_SECRET_KEY}", |
@@ -42,4 +42,18 @@ /* @flow */ | ||
}); | ||
}, | ||
collections: (username: string, page: number = 1, perPage: number = 10) => { | ||
const url = `/users/${username}/collections`; | ||
const query = { | ||
page, | ||
per_page: perPage | ||
}; | ||
return this.request({ | ||
url, | ||
method: "GET", | ||
query | ||
}); | ||
} | ||
}; | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
105705
2404
822
4