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 🙏

© 2026 – Pkg Stats / Ryan Hefner

search-engine-tool

v1.0.4

Published

可能是免费中最好用的搜索引擎API工具

Readme

开源搜索引擎API

因为OpenAI的横空出世,大家都习惯于使用OpenAI来问问题,但是OpenAI有一个致命的问题,就是只知道他训练的知识,而不知道新的知识,比如你问他今天深圳的天气如何,问他一些热点新闻,他是没有任何概念的。

解决办法

通常我们为了让大模型“感知“到新的知识,我们需要将新的知识材料提供给他大模型学习,因此基于软件开发第一定律,没有什么是做不到的,如果做不到,就加一层,如果还是做不到,就在加一层,咋们这个层就是一个通过搜索获取当前最新信息的层,将摘要给到大模型学习,然后大模型基于这些个新学习的知识来回答你的问题。

方案对比

为什么不直接使用 Google search API,而要自己造轮子,其原因就是一是因为巨硬们提供的API都是要付费的,免费计划也需要绑visa卡等,特别麻烦,因此还不如自己动手实现一个免费的。

原理

原理很简单,使用 无头浏览器 去访问 Google,bing 等搜索网站,分析网页内容,提取摘要。

已支持的搜索引擎

bing/google/duckduckgo/yahoo

使用方式

npm i search-engine-tool

const searchEngineTool = require('search-engine-tool');
//import searchEngineTool from "search-engine-tool" // module

const query = '深圳市天气';
const engine = 'bing';

searchEngineTool(query, engine)
  .then(results => {
    console.log('搜索结果:');
    results.forEach(result => {
      console.log('标题:', result.title);
      console.log('链接:', result.href);
      console.log('摘要:', result.abstract);
      console.log('----------------------');
    });
  })
  .catch(error => {
    console.error('发生错误:', error);
  });

效果预览

支持特性

  • [x] Google
  • [x] Bing
  • [x] DuckDuckGo
  • [x] yahoo

开源共建

让我们一起改进,把这个搜索API做得更加好用一些。

给我打 call

如果你觉得对你有用,就请我一杯咖啡。

加入群聊

添加我,注明自己 github 账号名,入群的目的,加入群聊,一起学习。

License: MIT

本项目采用 MIT 许可证授权。