New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sitetopdf-watcher

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sitetopdf-watcher

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

1.0.1
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

html-to-pdf

FAQs

Package last updated on 06 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts