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

@ist-group/pdf-viewer

v0.1.0

Published

A PDF viewer for Vue 3, drawn with pdf.js: pages on canvas, paging, zoom, thumbnails and printing that works under a strict CSP.

Readme

@ist-group/pdf-viewer

A PDF viewer for Vue 3, drawn with pdf.js: every page on a canvas, a toolbar for paging and zoom, page thumbnails, and print() / download() for the app's own buttons. It has no print, download or save buttons of its own.

It works under a strict Content Security Policy: it reads the PDF's bytes instead of opening a blob URL, and prints the pages as images. What it needs from the CSP: worker-src 'self' (the pdf.js worker) and img-src data: (printing).

Moved from ist-elev (platform-core/src/components/NSACustomComponents/NsaPdfView) with its git history.

Use

import '@ist-group/pdf-viewer/style.css';
import { PdfViewer, pdfViewerLabelsEn } from '@ist-group/pdf-viewer';
<div style="height: 80vh">
  <PdfViewer ref="pdfView" :pdf="blob" title="Fraværsstamkort for Clara Jensen" />
</div>
await pdfView.value?.print(); // true once the print dialog has closed, false if nothing was printed
pdfView.value?.download('Fravaersstamkort_Clara_Jensen.pdf');
  • pdf: the PDF as a Blob.
  • title: the viewer's accessible name.
  • labels (optional): texts in place of the Danish defaults, all or some. pdfViewerLabelsEn is English.

The viewer fills its parent, so give the parent a height. pdf.js and its worker are loaded the first time a PDF is shown, not with the app.

Requirements

  • Vue 3.5 or newer (a peer dependency).
  • A bundler that understands Vite's ?url imports: the package imports the pdf.js worker as pdfjs-dist/legacy/build/pdf.worker.min.mjs?url, and the app's build emits it as a file of its own.

Colors

Every color is a CSS custom property you can set on the viewer or any element around it: --pdf-viewer-background, -surface, -border, -focus, -caption, -icon, -spinner, -error-bar, -error-surface, -error-text. Unset, each takes the CUI design token of the same role (--cui-background-dashboard and so on), and CUI's own default when the app has no CUI.

Develop

pnpm install
pnpm lint        # ESLint, then prettier --check; fixes nothing
pnpm lint:fix    # ESLint --fix, then prettier --write
pnpm test        # vitest, jsdom
pnpm typecheck   # vue-tsc
pnpm build       # dist/: index.js, the lazy PdfJsViewer chunk, pdf-viewer.css and .d.ts files

The lint rules are ist-elev's (frontend/shell/eslint.config.ts, frontend/.prettierrc) without what only ist-elev has: its auto-import globals, its own ist-rules/*, Tailwind and Apollo. eslint.config.ts says what was left out.

CI

Jenkinsfile here is the package's pipeline: the multibranch job ISTElev/ist-elev-pdf-viewer with script path packages/pdf-viewer/Jenkinsfile, beside the service's service/Jenkinsfile. It builds when packages/pdf-viewer/ changed (or with ForceBuild): install with the frozen lockfile, lint (SkipLint skips it), typecheck, test (JUnit report), build, and pnpm pack, whose tarball it archives. pnpm comes from corepack, at the version packageManager names.

A tag pdf-viewer-v<version>, or the Publish parameter, adds the Publish stage, which publishes that archived tarball. A tag must name the version in package.json, or the build fails. Other tags in the repo (the service's) are skipped.

Publish

Public on npmjs.org, in the ist-group org beside CommonUI's @ist-group/* packages, MIT as theirs are. A consumer needs no registry setting: @ist-group resolves from the default registry. publishConfig in package.json names the registry and "access": "public", which npm requires for a scoped package's first publish. Publishing takes an npm account that is a member of ist-group; an org admin invites it.

By hand, logged in with npm login: pnpm publish. npm asks for a 2FA code, and prepublishOnly runs lint, typecheck, tests and the build first. A version can be published once; the next needs a bump.

From Jenkins, first:

  1. On npmjs.com: a granular access token with read and write on @ist-group (or this package alone once it exists) and Bypass 2FA on. Write tokens live 90 days at most, so it is renewed each quarter.
  2. In Jenkins: a credential, kind Secret text, holding that token.
  3. In Jenkinsfile, environment: NPM_CRED set to that credential's id. While it is empty, Publish fails saying so.
  4. In the job: tag discovery on (docs/jenkins-setup.md, Tags) if publishing should follow tags.

Then publish by pushing a tag pdf-viewer-v<version> for the version in package.json, or by running the branch's build with Publish ticked.