# ghmd2pdf

> module and cli tool for converting github markdown to pdf

Latest version **1.0.2** (published 2016-01-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install ghmd2pdf
pnpm add ghmd2pdf
yarn add ghmd2pdf
bun add ghmd2pdf
```

Provides the command `ghmd2pdf`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-01-28 |
| First published | 2015-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Known vulnerabilities | 0 (+8 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | nskazki@gmail.com |
| Maintainers | nskazki |
| Keywords | github, markdown, converter |

## Links

- npm: https://www.npmjs.com/package/ghmd2pdf
- Repository: https://github.com/nskazki/ghmd2pdf
- Homepage: https://github.com/nskazki/ghmd2pdf#readme
- Issues: https://github.com/nskazki/ghmd2pdf/issues
- npm.io page: https://npm.io/package/ghmd2pdf

## Dependencies (10)

- [chalk](https://npm.io/package/chalk.md) ^1.1.1
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [bellman](https://npm.io/package/bellman.md) ^1.0.9
- [request](https://npm.io/package/request.md) ^2.62.0
- [bluebird](https://npm.io/package/bluebird.md) ^2.10.0
- [html-pdf](https://npm.io/package/html-pdf.md) ^1.4.0
- [commander](https://npm.io/package/commander.md) ^2.8.1
- [promisepipe](https://npm.io/package/promisepipe.md) ^1.0.1
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^5.8.24

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-01-28
- 1.0.1 — 2015-09-17
- 1.0.0 — 2015-09-17

## README

# ghmd2pdf

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

Способ конвертации:
 1. md → html - используя github API.
 2. html → pdf - используя проект [html-pdf](https://github.com/marcbachmann/node-html-pdf).

### CLI

```
npm i -g ghmd2pdf
```

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

### Module

```
npm i -S ghmd2pdf
```

#### ghmd2pdf

```js
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

```js
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

```js
var ghmd2html = require('ghmd2pdf').ghmd2html

ghmd2html('# hello world!')
    .then(console.info)
    .catch(console.error)
```

#### html2pdf

```js
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

---
_Source: https://npm.io/package/ghmd2pdf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
