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

@vouchington/embeds

v0.0.2

Published

Policy-injected HTML unfurl and oEmbed resolution with SSRF-safe transport.

Readme

@vouchington/embeds

Policy-injected HTML unfurl and oEmbed resolution for Node.js applications.

The package fetches HTML through @vouchington/http-transport, extracts document metadata through @vouchington/crawler-html, optionally resolves JSON oEmbed, and returns only normalized metadata. Raw oEmbed HTML is never returned. Host allowlists, robots decisions, credentials, and persistence remain application policy.

Usage

import { createEmbedResolver } from '@vouchington/embeds'
import { youtubeProvider, vimeoProvider } from '@vouchington/embeds/providers'

const resolver = createEmbedResolver({
  fetch,
  userAgent: 'example-crawler/1.0 (+https://example.com/crawler)',
  providers: [youtubeProvider, vimeoProvider],
  authorizeUrl: async (url, { purpose, sourceUrl }) => {
    // Apply app-owned host, robots, and article/player policy here.
    return policy.allows(url, { purpose, sourceUrl })
  },
  resolveDestination: async (url, signal) => {
    // Validate DNS/IPs and return an Undici dispatcher pinned to that decision.
    return await ssrfResolver.resolve(url, signal)
  },
})

const metadata = await resolver.resolve('https://www.youtube.com/watch?v=example')

authorizeUrl runs before destination resolution for the document, every redirect, the oEmbed endpoint and every oEmbed redirect. Player URLs are also authorized before they can appear in the result. A denied document fails resolution; a denied player produces article metadata instead. oEmbed is optional, so endpoint, payload, and policy failures call onOEmbedError and fall back to document metadata.

Author, provider, and thumbnail URLs are opaque metadata and are not fetched or authorized by this package. A consumer must apply its own policy before fetching, proxying, or navigating to them.

If an application already extracted a document with @vouchington/crawler-html, use resolveExtracted to avoid fetching it again:

const metadata = await resolver.resolveExtracted({ documentUrl, content: extractedContent })

Applications that schedule remote work separately can split this into two phases. The plan is JSON-serializable and contains the HTML-derived result plus, when discovered, the remote request:

const plan = await resolver.planExtracted({ documentUrl, content: extractedContent })
await crawls.saveEmbedPlan(crawlId, plan)

// In an application-owned queue worker. Failures throw so its retry policy remains in control.
const metadata = await resolver.resolveOEmbed(plan)
await crawls.saveEmbedMetadata(crawlId, metadata)

The package does not enqueue work, retry requests, rate-limit hosts, or persist plans and results. Those orchestration decisions remain with the application.

Provider presets

No providers are enabled by default. The @vouchington/embeds/providers entrypoint exports opt-in presets for YouTube, Vimeo, and PeerTube plus matchEmbedProvider. Applications can implement the same EmbedProvider interface for other services.

The presets identify resources and supply canonical player/oEmbed URLs. They do not bypass authorizeUrl; the application remains responsible for deciding which document, endpoint, and player origins are allowed.

Limits

Document bodies default to 10 MiB, oEmbed bodies to 256 KiB, redirects to five, and the overall operation timeout to ten seconds. All are configurable. Responses are bounded while streaming and cancelled when a limit is exceeded.