npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

reverse-image-search

v0.0.0

Published

library & executable for reverse image searches

Downloads

78

Readme

reverse-image-search

library & executable for reverse image searches.

Supported Providers

  • "google": Google Reverse Image Search.

Install

CLI:

npm install -g reverse-image-search

Module:

npm install --save reverse-image-search

Requirements

You MUST be running a headless chrome (or chromium) remote debugging session (on port 9222) before running any of the examples. This module does not handle this for you at the moment and will return an error response if skipped.

You can start a headless chromium instance as such in another terminal:

$ chromium --headless --disable-gpu --remote-debugging-port=9222

It's up to you to determine the best way to do this given your requirements.

CLI

$ npm install -g reverse-image-search
$ ris --image-url https://i.imgur.com/XLXBB9z.jpg --pretty
{
  "ok": true,
  "data":{
    "provider": "google",
    "url": "https://www.google.com/search?tbs=sbi:xxx&hl=en"
  }
}

The url contains results from the reverse image search.

As a module

const { google } = require('reverse-image-search');

google.searchByImageURL({
  imageURL: 'https://i.imgur.com/XLXBB9z.jpg'
}).then(result => {
  console.log(result);
}).catch(err => {
  console.error(err);
});

Options

The options below are in the format:

  • <nodeOption>: <[type: default]> / --<cli-option> <[type: default]>.

In some cases, options are only supported in the CLI.


--pretty (default = false)

Should we pretty print the results?

imageURL: <string> / --image-url <string>

required unless --image-file is provided

Provide an image URL for performing a reverse image search with.

imageFile: <string> / --image-file <string>

required unless --image-url is provided

Provide an image file path for performing a reverse image search with.

provider: <string> / --provider <string> (default = "google")

Specify which provider to use, e.g. google.

language: <string> / --language <string> (default = "en")

provider specific

Language to pass to the provider.

e.g. Google supports en, fr, es, ...

userAgent: <string> / --user-agent <string> (default = "Firefox")

Specify a user agent to use with requests.

warning: this might invalidate assumptions this library makes when parsing the resulting HTML if you choose an obscure User Agent. Open an issue or a PR with a fix if this occurs.