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

@alikia/search-complete

v0.4.4

Published

Major search engine's autocomplete / query recommendation

Downloads

5

Readme

search-engine-autocomplete

This is a package for fetching major search engine's autocomplete / query recommendation.

Forked from capablemonkey/google-autocomplete, rewrite with typescript, using modern JS features, with zero dependencies.

Getting Started

Install:

npm i search-engine-autocomplete

yarn add search-engine-autocomplete

pnpm add search-engine-autocomplete

bun i search-engine-autocomplete

And using with:

import { completeGoogle } from "search-engine-autocomplete";
// if language not provided, default is "en-US"
const data = await completeGoogle("javascript round", "en-US");

data:

{
  "query": "javascript round",
  "suggestions": [
    {
      "suggestion": "javascript round to two decimal places",
      "relativeRelevance": 0.96308,
      "relevance": 1252,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round to integer",
      "relativeRelevance": 0.96231,
      "relevance": 1251,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round to 2 decimal places",
      "relativeRelevance": 0.96154,
      "relevance": 1250,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round up",
      "relativeRelevance": 0.61538,
      "relevance": 800,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round to 1 decimal",
      "relativeRelevance": 0.53846,
      "relevance": 700,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round down",
      "relativeRelevance": 0.46231,
      "relevance": 601,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round function",
      "relativeRelevance": 0.46154,
      "relevance": 600,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round float",
      "relativeRelevance": 0.42846,
      "relevance": 557,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round to nearest 5",
      "relativeRelevance": 0.42769,
      "relevance": 556,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round up to whole number",
      "relativeRelevance": 0.42692,
      "relevance": 555,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round to 3 decimal places",
      "relativeRelevance": 0.42615,
      "relevance": 554,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round to 4 decimal places",
      "relativeRelevance": 0.42538,
      "relevance": 553,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round to nearest 10",
      "relativeRelevance": 0.42462,
      "relevance": 552,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round decimals",
      "relativeRelevance": 0.42385,
      "relevance": 551,
      "type": "QUERY"
    },
    {
      "suggestion": "javascript round float to 2 decimals",
      "relativeRelevance": 0.42308,
      "relevance": 550,
      "type": "QUERY"
    }
  ],
  "verbatimRelevance": 1300
}

Relevance is calculated by Google. Usually, if relativeRelevance is greater than 0.98 or 1, then the suggestion could be considered as an auto-complete result and will be automatically filled into the search box in Chrome.