🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

b4n1-web

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

b4n1-web

B4n1Web SDK for JavaScript/TypeScript - Agentic Browser Engine with bundled binary

latest
Source
npmnpm
Version
0.12.3
Version published
Weekly downloads
90
-49.72%
Maintainers
1
Weekly downloads
 
Created
Source

B4n1Web JavaScript/TypeScript SDK

npm version License Node.js 18+

Ultra-lightweight agentic browser engine with bundled binary.

Install

npm install b4n1-web

Binary is bundled — no separate installation needed.

Quick Start

import { AgentBrowser, BrowserMode } from 'b4n1-web';

const browser = new AgentBrowser({ mode: BrowserMode.LIGHT });
const page = await browser.goto('https://example.com');
console.log(page.markdown);
console.log(`${page.links.length} links found`);
browser.close();

Page API

page.url                    // string
page.markdown               // string
page.links                  // string[]
page.screenshot             // string | undefined

page.getMainContent()       // string: content without headers
page.findLinksByText("more") // string[]: matching links

Browser Modes

ModeDescription
BrowserMode.LIGHTHTTP + HTML parsing
BrowserMode.JSLight + script extraction
BrowserMode.RENDERFull Chromium + screenshots

Security

import { SecurityShield } from 'b4n1-web';

const shield = new SecurityShield();
shield.markDomain('evil.com', false);
const { isSafe, needsApiCheck } = shield.isUrlSafe('https://evil.com');

Error Handling

import { BinaryNotFoundError } from 'b4n1-web';

try {
  const browser = new AgentBrowser();
} catch (e) {
  if (e instanceof BinaryNotFoundError) {
    console.error('Install binary: curl -sL https://b4n1.com/install | bash');
  }
}

Context Manager

import { AgentBrowser } from 'b4n1-web';

async function main() {
  const browser = new AgentBrowser();
  try {
    const page = await browser.goto('https://example.com');
    console.log(page.markdown);
  } finally {
    browser.close();
  }
}

// Or with async dispose:
const browser = new AgentBrowser();
try {
  await browser.goto('https://example.com');
} finally {
  await browser[Symbol.asyncDispose]();
}

Version

SDK: 0.9.8 | Binary: 0.9.6 (bundled)

  • npm
  • GitHub
  • Website

Built by B4N1 with ❤️ · All rights reserved.

Keywords

browser

FAQs

Package last updated on 08 Jul 2026

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