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

@mostajs/doc-driver-chrome

v0.1.0

Published

Driver de rendu PDF pour @mostajs/doc-export via un binaire Chrome/Chromium headless (--print-to-pdf). Reproduit la voie serveur de md2View. `run` injectable (testable sans Chrome) ; aucune dépendance @mostajs ; le navigateur est une dépendance système.

Readme

@mostajs/doc-driver-chrome

Auteur : Dr Hamid MADANI [email protected] Licence : AGPL-3.0-or-later · Niveau : N2 · Sans build

Driver PDF pour @mostajs/doc-export via un binaire Chrome/Chromium headless (--print-to-pdf) — c'est la voie serveur éprouvée de l'outil md2View. Rendu moderne (CSS/JS complets). La taille de page (A4 / 16:9) vient du CSS @page du thème (@mostajs/doc-themes) : le driver n'impose rien.

Il implémente le contrat RenderDriver (toPdf(html, { out })), sans dépendance @mostajs ; le navigateur est une dépendance système (Chrome, Chromium ou Brave). wkhtmltopdf est mort (CVE non corrigées) — on ne l'utilise jamais.

Install

npm i @mostajs/doc-export @mostajs/doc-driver-chrome
# + un navigateur : sudo apt install chromium   (ou Google Chrome)

Usage (serveur)

import { createDocExporter } from '@mostajs/doc-export'
import { createChromeCliDriver } from '@mostajs/doc-driver-chrome'
import { createPaletteTheme } from '@mostajs/doc-themes'
import * as markdown from '@mostajs/markdown-html'

const doc = createDocExporter({
  markdown: { toHtml: (md) => ({ html: markdown.mdToHtml(md).html }) },
  theme:    createPaletteTheme(),
  drivers:  { pdf: createChromeCliDriver() },     // auto-détecte le navigateur
})

await doc.render({ source, format: 'pdf',        theme: 'hadhinat', out: 'rapport.pdf' })
await doc.render({ source, format: 'slides-pdf', theme: 'dark',     out: 'deck.pdf' })   // 16:9 via CSS @page

API

createChromeCliDriver({ chrome?, candidates?, run?, exists? }) -> { toPdf(html, { out? }) -> Uint8Array }

  • chrome : chemin du binaire (sinon CHROME env, sinon auto-détection parmi google-chrome, chromium, brave-browser…).
  • run : injectable(bin, args) => Promise (par défaut execFile, sans shell). Sert aux tests.
  • out fourni → PDF conservé à ce chemin et octets retournés ; sinon fichier temporaire nettoyé.

Notes

  • Options Chrome : --headless --disable-gpu --no-sandbox --no-pdf-header-footer --print-to-pdf (ni en-tête ni pied de page ; fonds/couleurs conservés).
  • Le HTML autonome (CSS embarqué par doc-export) est écrit en fichier temporaire puis chargé en file:// — les ressources doivent donc être inlinées (ce que fait doc-export).

Tests

npm test   # `run` injecté (faux chrome) — aucun navigateur requis