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

ghmd2pdf

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

ghmd2pdf

module and cli tool for converting github markdown to pdf

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

ghmd2pdf

  • Консольная утилита для конвертации: md → pdf.
  • Модуль для конвертации: md → html → pdf.

Способ конвертации:

  1. md → html - используя github API.
  2. html → pdf - используя проект html-pdf.

CLI

npm i -g ghmd2pdf

Опции:

  • -h - Help.
  • -s - Исходный файл в формате markdown. Используется вместе с -d.
  • -d - Фал назначения.
  • -S - Дирректория в которой будет выполнен рекурсивный поиск markdown файлов. Используется вместе с -D.
  • -D - Дирриктория назначения, в которой с сохранением иерархии будут сохранены pdf файлы. Имена файлов будет сохранены, изменится только расширение.

Module

npm i -S ghmd2pdf
ghmd2pdf
var createWriteStream = require('fs').createWriteStream
var ghmd2pdf = require('ghmd2pdf').ghmd2pdf

var destPath = './HelloWorld.pdf'
var dest = createWriteStream(destPath)
ghmd2pdf('# hello world!')
    .pipe(dest)
    .on('end', function() { console.info('done!') })
    .on('error', console.error)
ghmd2pdfFile
var ghmd2pdfFile = require('ghmd2pdf').ghmd2pdfFile
var sourcePath = './node_modules/ghmd2pdf/README.md'
var destPath = './README.pdf'

ghmd2pdfFile(sourcePath, destPath)
    .then(function() { console.info('done!') })
    .catch(console.error)
ghmd2html
var ghmd2html = require('ghmd2pdf').ghmd2html

ghmd2html('# hello world!')
    .then(console.info)
    .catch(console.error)
html2pdf
var createWriteStream = require('fs').createWriteStream
var html2pdf = require('ghmd2pdf').html2pdf

var destPath = './HelloWorld.pdf'
var dest = createWriteStream(destPath)
html2pdf('<h1>hello world!</h1>')
    .pipe(dest)
    .on('end', function() { console.info('done!') })
    .on('error', console.error)

License

MIT

Keywords

FAQs

Package last updated on 28 Jan 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc