Guess the image content using Google search.
$ npm install searchbyimage -Sconst searchByImage = require('searchbyimage');
const image = 'https://pixabay.com/static/uploads/photo/2014/11/07/21/39/oporto-521258_640.jpg';
// Using callback
searchByImage(image, (err, res)=> {
console.log(res); // {guess: 'night'}
})
// or promise
searchByImage(image).then((res)=> {
console.log(res); // {guess: 'night'}
})userAgent- Theuser-agentstring used in request.language- Google result language (supported langs) (default:'en')
To run the test suite, first install the dependencies, compile and then run npm test:
$ npm install
$ npm run build
$ npm test