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 🙏

© 2025 – Pkg Stats / Ryan Hefner

browser-use-js

v1.0.9

Published

Enable AI to control your browser - TypeScript version

Readme

Browser-Use-JS

使用AI控制您的浏览器 - TypeScript版本。这是Browser-Use Python库的TypeScript/Node.js移植版本非官方版本。

简介

Browser-Use-JS是一个Node.js库,它使AI代理能够像人类一样控制浏览器。它基于Playwright和LangChain,允许AI代理执行以下操作:

  • 导航到网站
  • 点击元素
  • 填写表单
  • 提取内容
  • 在多个标签页之间切换
  • 执行复杂的浏览任务

快速开始

使用npm安装:

npm install browser-use-js

安装Playwright:

npx playwright install

创建您的代理:

import { ChatOpenAI } from '@langchain/openai';
import { Agent } from 'browser-use-js';
import * as dotenv from 'dotenv';

// 加载环境变量
dotenv.config();

async function main() {
  // 初始化语言模型
  const llm = new ChatOpenAI({
    modelName: 'gpt-4o',
    temperature: 0.0,
  });

  // 创建代理实例
  const agent = new Agent(
    task: "前往Reddit,搜索'browser-use',点击第一个帖子并返回第一条评论。",
    llm: llm,
  );

  // 运行代理
  const result = await agent.run();
  console.log(result);
}

main().catch(console.error);

为您想使用的提供商将API密钥添加到您的.env文件中:

OPENAI_API_KEY=your_api_key_here

功能

  • 🌐 完全控制浏览器
  • 🤖 AI驱动的自动化
  • 📷 视觉理解
  • 🧠 复杂任务规划
  • 📊 DOM处理
  • 🔄 多标签页支持

注意

  • 该项目由cursor转码+人工校验,可能会有错误,请提issue
  • 搜索引擎由原来的google改为baidu
  • 内部打印的字符转为中文
  • 未实现gif录像功能

示例

查看examples目录以获取更多示例代码。

贡献

欢迎贡献!请随时提交问题或功能请求。

许可证

ISC

致谢

该项目是Browser-Use Python库的TypeScript移植版本,感谢原始项目的作者创建了这个出色的工具。

Citation

@software{browser_use2024,
  author = {Müller, Magnus and Žunič, Gregor},
  title = {Browser Use: Enable AI to control your browser},
  year = {2024},
  publisher = {GitHub},
  url = {https://github.com/browser-use/browser-use}
}