🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

autocompl

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autocompl

Wrapper for suggestqueries.google.com queries. Gets the autocomplete suggestions that the Google search bar would give you if you were typing in it.

1.1.0
latest
npm
Version published
Weekly downloads
4
-20%
Maintainers
1
Weekly downloads
 
Created
Source

autocompl

This module gets you Google Search autocomplete suggestions for given strings. It's a wrapper around calls to suggestqueries.google.com as documented in Sheryas Chand's blog post.

(The joke in the module name is derived from incompl's username.)

Installation

npm install autocompl

Usage

var autocompl = require('../autocompl');
autocompl('Batman and', function done(error, suggestions) {
  console.log(suggestions);
});

Output:

[ 
  'batman and robin',
  'batman and robin costumes',
  'batman and catwoman',
  'batman and superman',
  'batman and wonder woman',
  'batman and robin quotes',
  'batman and son',
  'batman and robin 35',
  'batman and robin poison ivy',
  'batman and superman team up'
]

It will also take a opts object as the first paramter that lets you specify:

  • partialSearchTerm: The search string you want autocompleted.
  • request: A function that has the same signature as request, in case you want to have another module handle http.

Tests

Run tests with make test.

License

MIT.

Keywords

autocomplete

FAQs

Package last updated on 20 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts