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

pdfviewer-embed

v0.4.1

Published

Embed PDF Viewer Native in a web page: an API modelled on Adobe PDF Embed API, with the viewer's own engine running in the browser as WebAssembly. No client ID, no server, no telemetry.

Readme

pdfviewer-embed

Show PDF files in your web page with PDF Viewer Native's own engine. The engine runs in the reader's browser as WebAssembly. There is no client ID, no account, no server and no telemetry: the file goes from your page to the viewer in the same browser tab, and nowhere else.

The API follows the Adobe PDF Embed API, so code written for it needs few changes. Status: preview. The API can change before version 1.0.

  • Embed modes: full window, sized container, in line, light box.
  • Events and viewer APIs: pages, zoom, search, selection.
  • Annotations: highlight, underline, strike-through, note, free text, ink, rectangle and ellipse, an annotation manager, XFDF import and export.
  • Saving with SAVE_API, form filling with calculations (document JavaScript never runs).
  • Large files open by range requests, so the first page shows before the whole file downloads.

Install

npm install pdfviewer-embed

Use

<div id="viewer" style="height: 600px"></div>
import { View } from 'pdfviewer-embed';

const view = new View({ divId: 'viewer' });
view.previewFile(
  { content: { location: { url: '/files/report.pdf' } }, metaData: { fileName: 'report.pdf' } },
  { embedMode: 'SIZED_CONTAINER' });

Your page must be served over http or https. The package works only in a browser; with server-side rendering, import it in client code only.

Where the viewer comes from

This package holds the SDK script only. The viewer that it shows in an iframe (the app and the engine) is not in the package. By default the viewer comes from the project's site, https://ramanacr.github.io/pdf-viewer/demo/, which changes on each deploy.

For production, host your own copy of the viewer, from a release or a commit that you chose, and pass its address:

new View({ divId: 'viewer', baseUrl: 'https://pdf.example.com/', isolation: 'require' });

See Host the viewer yourself and Production.

As a classic script

pdfviewer-embed/script is the same SDK as a classic script that defines the global PdfViewer. Loaded by a <script src> tag, it finds the viewer in its own folder.

Documentation

  • SDK guide and API
  • Examples: full window, sized container, in line, light box, events and APIs, file picker, annotations, forms, large files, React and Angular.

Licence

MIT. The package is built from src/PdfViewer.Web/wwwroot/pdfviewer-embed.js and published from GitHub Actions with npm provenance.