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

doc-to-pdf-converter

v1.0.3

Published

Converts all .doc & .docx files in a specified folder and its subdirectories to pdf

Readme

doc-to-pdf-converter

Description

doc-to-pdf-converter is a Node.js-based application that recursively converts all .doc and .docx files in a specified folder and its subdirectories to PDF. The application ensures all Microsoft Word instances are terminated before the conversion process starts, and provides detailed logging throughout the process. This package tested only on Windows OS, not yet tested on Linux or MacOS

Features

  1. Recursively converts .doc and .docx files to PDF

  2. Handles subdirectories

  3. Terminates all running Microsoft Word instances before starting the conversion

  4. Provides detailed logging with timestamps and process times

  5. Skips temporary Word files to avoid errors

Requirements

  1. Node.js(v14 or higher)

  2. npm (Node Package Manager)

  3. Microsoft Word (for the VBScript to interact with)

  4. Windows OS (Not tested on Linux or MacOS)

Installation

Globally:

  • Install globally if you plan to use it directly from Command line:
npm install -g doc-to-pdf-converter

Locally:

  • Install locally to a project to use it within your project:
npm i doc-to-pdf-converter

Executable

  • You can create executable file (.exe) to use it from any place on your local directory or other devices, in package.json => pkg => targets keep the target OS for your executable file and remove others, then run the following command:
npm run pack
  • .exe file will be created in the root directory,use the .exe file any place you want from the command line as follow:
doc-to-pdf-converter --input "path/to/input/folder" --output "path/to/output/folder" --log-level debug

Usage

Usage from command-line:

  • From command line run:
node build/index.js --input "path/to/input/folder" --output "path/to/output/folder" --log-level debug

import convert2PDF from 'doc-to-pdf-converter';

async () => {
	const result = await convert2PDF(
		false,
		true,
		'path-to-input-folder',
		'path-to-output-folder',
		'<log-level> (default "info")',
		'path-to-log-file(default"Output folder")'
	);
};

Command-line options:

  • --input, -i: Input directory path (required)

  • --output, -o: Output directory path (default: ./exported)

  • --log-level, -ll: Log level (info, debug, warn; default: info)

  • --log-file, -lf: Log file path (default: ./convert-.log)

Example

node build/index.js --input "C:\path\to\input\folder" --output "C:\path\to\output\folder" --log-level debug --log-file "./logs/convert.log"

Project Structure

doc-to-pdf-converter/ ├── src/ │ ├── index.js │ ├── convertDocToPdf.js | |── ConsoleColorLogger.ts ├── assets/ │ ├── script.vbs |── Types/ | |── types.d.ts | |── global.d.ts ├── package.json ├── README.md ├── tsconfig.json

Logging

The application provides detailed logs with timestamps and process times. Logs can be saved to a file or printed to the console.

Contributing

Contributions are welcome! Please submit a pull request or open an issue for any suggestions or improvements.

License

This project is licensed under the ISC License.

Author

Mustafa Heidar

Repository

You can find the GitHub repository for this project at: [doc-to-pdf-converter] (https://github.com/kdkibtops/doc2pdf.git)

Changelog

v1.0.1-v1.0.2

  • Updated dependencies to the latest versions.
  • Fixed issues with logging to console and file.
  • Improved error handling during the conversion process.
  • Fixed output directory structure, now all created filed are grouped into one directory without any subdirectories.
  • Fixed issue with created files extension, now original file extension is removed from the file name.
  • VBS script will be created by the application if not exists, in case the app is running from pkg, the created temp_script.vbs will be removed once finished, however if app is running from node the created script will remain in the assets folder.
  • Managed log levels accordingly.
  • Quiet and no logging mode feature.
  • Fixed types declarations error, currently all types are properly defined