Modules
- node-google-image
Find image data using the deprecated Google Image Search API. Google has disabled the API. As such, this module is no longer functional.
Classes
Typedefs
- responseDataResults :
Array.<imageData>
Response data results
- imageData :
Object.<string, function()>
Image data extended with the image's filename and convenience methods
node-google-image
Find image data using the deprecated Google Image Search API. Google has disabled the API. As such, this module is no longer functional.
Author: Matthew Hasbach
License: MIT
Copyright: Matthew Hasbach 2015
Example
'car' ;
node-google-image~googleImage
Kind: inner class of node-google-image
node-google-image
Kind: global class
Param | Type | Description |
---|---|---|
[q] | string |
A search query. This may be omitted and supplied later using the options or search method. |
- node-google-image
- .quantity(quantity) ↩︎
- .page(page) ↩︎
- .options(opt) ↩︎
- .search([opt], [cb]) ⇒
Promise
node-google-image.quantity(quantity) ↩︎
Set the desired size of the result set
Kind: instance method of node-google-image
Chainable
Param | Type | Description |
---|---|---|
quantity | number |
The result set size |
node-google-image.page(page) ↩︎
Set the desired page number
Kind: instance method of node-google-image
Chainable
Param | Type | Description |
---|---|---|
page | number |
The page number |
node-google-image.options(opt) ↩︎
Set Google Image Search API options
Kind: instance method of node-google-image
Chainable
Param | Type | Description |
---|---|---|
opt | Object |
API options |
Promise
node-google-image.search([opt], [cb]) ⇒ Search for images. The default page and quantity are 0 and 1, respectively.
Kind: instance method of node-google-image
Param | Type | Description |
---|---|---|
[opt] | Object |
API options |
[cb] | callback |
A callback to be executed once the search is complete |
Array.<imageData>
responseDataResults : Response data results
Object.<string, function()>
imageData : Image data extended with the image's filename and convenience methods
Kind: global typedef
- imageData :
Object.<string, function()>
- .fileName :
string
- .download([cb]) ⇒
Promise
- ~callback :
function
- ~callback :
- .save(path, [cb]) ⇒
Promise
- ~callback :
function
- ~callback :
- .fileName :
string
imageData.fileName : Image filename
Kind: instance property of imageData
Promise
imageData.download([cb]) ⇒ Download an image
Kind: instance method of imageData
Param | Type | Description |
---|---|---|
[cb] | callback |
A callback to be executed once the download is complete |
function
download~callback : Kind: inner typedef of download
Param | Type | Description |
---|---|---|
err | Error | null |
An error if one was encountered |
imageData | Buffer | undefined |
Image data |
Promise
imageData.save(path, [cb]) ⇒ Save an image
Kind: instance method of imageData
Param | Type | Description |
---|---|---|
path | string |
A callback to be executed once the image has been saved |
[cb] | callback |
A callback to be executed once the image has been saved |
function
save~callback : Kind: inner typedef of save
Param | Type | Description |
---|---|---|
err | Error | null |
An error if one was encountered |