]> git.lizzy.rs Git - google_images.git/blobdiff - README.md
Bump release
[google_images.git] / README.md
index 7fca40f62248d4b6f3fc07e431086c699a948bc3..856c488dd73c7b1a124e4bebdf5555ad386d585a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ The usage of this API does NOT require an API key, nor is it rate limited.
 
 ## Usage
 
-Exports `search` function that takes query string as first argument and optionally user agent as second. Usage of the user agent argument has not been tested.
+Exports `search` function that takes query string as first argument, a boolean safeSearch as second and optionally user agent as second. Usage of the user agent argument has not been tested.
 `search` returns an promise that resolves to an array with objects like this (should be self-explanatory):
 
 ```js
@@ -27,7 +27,11 @@ Exports `search` function that takes query string as first argument and optional
 ### Example
 
 ```js
-const {search} = require("free-google-images");
-search("astolfo+images").then(results => results.forEach(r => console.log(r.image.url)))
+const google_images = require("free-google-images");
+
+google_images.search("astolfo+images").then(results => results.forEach(r => console.log(r.image.url)))
+google_images.searchRandom("astolfo+images").then(result => console.log(result.image.url))
+
+google_images.searchRandom("hentai", true).then(result => console.log(result.image.url)) // no results because of safe search
 ```