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

node-obscura

v0.2.0

Published

Node.js native bindings for the Obscura headless browser

Downloads

290

Readme

node-obscura

A lightweight, embeddable headless browser for AI agents and web scraping, built with Obscura.

node-obscura packages Obscura as a Node.js library with a lightweight scrape API and a Puppeteer-compatible transport, so agents and scraping tools can run browser workflows without managing a separate browser process.

Install

npm install node-obscura

Usage

Direct Scrape

const { scrape } = require('node-obscura')

async function main() {
  const page = await scrape('https://example.com', {
    waitUntil: 'networkidle0',
    includeLinks: true,
    eval: 'document.title',
  })

  console.log(page.title)
  console.log(page.text)
  console.log(page.markdown)
  console.log(page.links)
}

main().catch(error => {
  console.error(error)
  process.exitCode = 1
})

scrape() is the small path for simple pages: it opens one URL, waits for the page or a selector, and returns extracted text and Markdown by default. Enable includeHtml or includeLinks when you need those heavier fields. For multi-step interactions, forms, CDP control, or full browser automation, use the Puppeteer transport instead.

With Puppeteer

node-obscura can provide a Puppeteer transport backed by Obscura's CDP session. Install puppeteer-core alongside this package:

npm install node-obscura puppeteer-core
import puppeteer from 'puppeteer-core'
import obscura from 'node-obscura'

const { createPuppeteerTransport } = obscura

const transport = createPuppeteerTransport({
  stealth: true,
})

const browser = await puppeteer.connect({
  transport,
  defaultViewport: null,
})

try {
  const page = await browser.newPage()
  await page.goto('https://example.com', {
    waitUntil: 'domcontentloaded',
  })

  console.log(await page.title())

  const cdp = await page.createCDPSession()
  const { markdown } = await cdp.send('LP.getMarkdown')
  console.log(markdown)
} finally {
  await browser.close()
}

Build From Source

This repository does not vendor Obscura upstream source code. During setup it downloads the pinned upstream commit into vendor/obscura, applies the compatibility patches in patches/, and builds the local native addon.

Pinned upstream commit:

99e75f1e62930f864302db9c4d18e91e7ee3f0bd

Requirements

  • Node.js 18+
  • npm
  • git
  • Rust/Cargo

The first install builds the native addon from source.

For local development:

npm install
npm test

Patch Workflow

Only upstream Obscura compatibility changes belong in patches/. The local N-API crate in crates/node-obscura is first-class project source and should be committed directly, not generated as a patch.

To update upstream patches:

npm run setup
# edit upstream files under vendor/obscura
npm run patch:generate -- my-change
git add patches/my-change.patch patches/series

Use npm run patch:status to check whether vendor/obscura has source changes waiting to be turned into a patch.

Do not commit vendor/obscura/, target/, generated .node files, or napi-generated.d.ts.

Source Metadata

The upstream repository and pinned commit are stored in obscura-source.json.

Credits

Credit for the browser engine and core implementation belongs to the upstream Obscura project. This package provides Node.js bindings, packaging, and compatibility patches around a pinned upstream commit.