🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

markdown-to-pdf-converter

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-to-pdf-converter

A tool that allows developers to easily convert Markdown files to PDF documents

1.1.1
latest
Source
npm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Markdown-to-PDF-Converter

This is a simple Node.js module that converts Markdown files to PDF. It uses markdown-it for Markdown to HTML conversion and puppeteer for HTML to PDF conversion.

Installation

You can install this package using npm:

npm install --save markdown-to-pdf-converter

https://www.npmjs.com/package/markdown-to-pdf-converter

Or By Yarn:

yarn add markdown-to-pdf-converter

This package has the following dependencies:

  • fs and path (built-in Node.js modules)
  • markdown-it
  • puppeteer

Usage

Here's a simple example of how to use this module:

const convertMarkdownToPDF = require('markdown-to-pdf-converter');

const markdownFilePath = './path/to/your/markdown.md';
const pdfFilePath = './path/to/output.pdf';

convertMarkdownToPDF(markdownFilePath, pdfFilePath);

Replace './path/to/your/markdown.md' and './path/to/output.pdf' with the actual paths to your Markdown file and where you want the PDF to be saved, respectively.

API

convertMarkdownToPDF(markdownFilePath, pdfFilePath)

This function converts a Markdown file to a PDF file.

Parameters

  • markdownFilePath (string): The path to the Markdown file to convert.
  • pdfFilePath (string): The path where the generated PDF file should be saved.

Returns

This function returns a Promise that resolves when the PDF file has been created successfully.

License

This package is licensed under the MIT license.

Keywords

markdown

FAQs

Package last updated on 21 Dec 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