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 🙏

© 2024 – Pkg Stats / Ryan Hefner

sitetopdf-watcher

v1.0.1

Published

A tool to watch HTML file changes and convert them to PDF in real-time.

Downloads

12

Readme

sitetopdf-watcher

A Node.js command-line tool that watches for changes in HTML files and automatically converts them to PDF using sitetopdf.

Features

  • Real-time monitoring of HTML file changes.
  • Automatic conversion of updated HTML files to PDF.
  • Customizable through a simple JSON configuration.

Installation

To install sitetopdf-watcher globally, run the following command:

npm install -g sitetopdf-watcher

This will install the package globally on your system, allowing it to be run from any location.

Usage

After installation, you can start watching a directory with the following command:

sitetopdf-watcher --port 3333 --entry-file index.html

By default, sitetopdf-watcher will serve files on port 3333 and watch the index.html file for changes.

Options

  • -p, --port <port>: Specify the port on which the file server will run. Default is 3333.
  • -e, --entry-file <file>: Specify the path to the entry HTML file. Default is index.html.
  • -c, --config-file <file>: Specify the path to the configuration file. Default is config.json.

Configuration

Create a config.json file in your project directory to set custom options for PDF conversion. Here is an example configuration:

{
  "output": "output.pdf",
  "wait-until": "networkidle0"
}

The output field specifies the name of the created PDF file, and wait-until is an option passed to sitetopdf that defines when to consider the page load complete.

Development

If you wish to contribute to the project or fork it for your own modifications, here are some useful commands:

  • npm run build: Compiles the TypeScript source code.
  • npm run watch: Watches the TypeScript source for changes and recompiles.
  • npm run clean: Removes generated files.
  • npm start: Runs the compiled JavaScript code.