google-images-url v1.0.2
Google Images URL
š URL generator for Google images
Installation
npm install google-images-url
# or
yarn add google-images-urlUsage
import GoogleImagesUrl from 'GoogleImagesUrl'
GoogleImagesUrl.create('cute cats', { size: 'large' })
// > https://www.google.com/search?q=cute%20cats&tbs=isz:l,qdr:a&tbm=ischAPI
GoogleImagesUrl(query, options)query- The term used for the search.options- An object containing options to customize the Google Images URL.
query
The query is the term used for the search. It should be a string.
options
The options parameter is an object containing different values:
sizeā{String|Object}The size of the images. If a string is provided then it should be one of the following values:icon,mediumorlarge. If an object is provided it should containswidthandheightproperties.color-{String}The color of the images. The string should be one of the following values:orange,yellow,green,teal,blue,purple,pink,white,gray,blackorbrown.types-{String}The type of images. The string should be one of the following values:face,photo,clipart,lineartoranimated.showSizes-{Boolean}Show images sizes in results. Iftrueshow images sizes in results, otherwise no.time-{String|Object}The time range of the images. If a string is provided it should be one of the following values:anytime,second,minute,hour,day,week,monthoryear. If an object is provided it should containsfromandtoproperties. The values for these properties should be a string value representing a date in the format:mm/dd/yyyy.sortBy-{String}The sorting algorithm. The string should be one of the following values:dateorrelevance.
Tests
npm test
# or
yarn test