# ezpdf

> Easily convert markdown files to pdf

Latest version **1.0.7** (published 2021-10-11) · MIT license · 0 weekly downloads

## Install

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

Provides the command `ezpdf`.

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2021-10-11 |
| First published | 2021-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 11 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Matheus "Set" Inacio |
| Maintainers | heyset |

## Links

- npm: https://www.npmjs.com/package/ezpdf
- Repository: https://github.com/heyset/ezpdf
- Issues: https://github.com/heyset/ezpdf/issues
- npm.io page: https://npm.io/package/ezpdf

## Dependencies (11)

- [yaml](https://npm.io/package/yaml.md) ^1.10.2
- [unified](https://npm.io/package/unified.md) ^10.1.0
- [puppeteer](https://npm.io/package/puppeteer.md) ^10.4.0
- [http-server](https://npm.io/package/http-server.md) ^13.0.2
- [remark-parse](https://npm.io/package/remark-parse.md) ^10.0.0
- [rehype-format](https://npm.io/package/rehype-format.md) ^4.0.0
- [remark-rehype](https://npm.io/package/remark-rehype.md) ^10.0.0
- [rehype-document](https://npm.io/package/rehype-document.md) ^6.0.0
- [rehype-stringify](https://npm.io/package/rehype-stringify.md) ^9.0.2
- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^4.1.0
- [remark-frontmatter](https://npm.io/package/remark-frontmatter.md) ^4.0.0

## Recent versions

- 1.0.7 (latest) — 2021-10-11
- 1.0.6 — 2021-10-11
- 1.0.5 — 2021-10-11
- 1.0.4 — 2021-10-11
- 1.0.3 — 2021-10-11
- 1.0.2 — 2021-10-11
- 1.0.1 — 2021-10-10
- 1.0.0 — 2021-10-10

## README

# ezPDF

## What's this?

This is a simple markdown to pdf parser that supports custom CSS stylesheets.

In the future, ezPDF will allow you to preview files and maybe even edit them in the Browser using markdown.

## How can I use it?

Run
```bash
npx ezpdf [filename]
```
Substituting [filename] for the name of the markdown file you want to print as PDF.

For example:
```bash
npx ezpdf mylittlefile.md
```

Will produce a file named `mylittlefile.pdf`

This **takes a while** (about 20~30 seconds) to run, because npx has to temporarily install the Chromium browser.

If you find yourself using the command repeatedly, you may consider installing the package either globally or locally.

### Installing locally
If you find yourself converting the same file, you should consider installing the package locally.

Run
```bash
npm install ezpdf
```

or

```bash
yarn add ezpdf
```

Then, you can use `npx` as usual (`npx ezpdf [filename]`) to run the package from the local `node_modules/bin`, and it will run much faster (under 1s usually).

### Installing globally

Alternatively, if you find yourself parsing multiple files over different folders, you may want to install the package globally.

In that case, run

```bash
npm install -g ezpdf
```

or

```bash
yarn global add ezpdf
```

Afterwards, you can run

```
ezpdf [filename]
```

awywhere to get the same performance as running from a local installation.

## How does it work?

ezPDF runs on 3 steps:

1. Converts the markdown file to HTML using an [unified](https://unifiedjs.com/) pipeline. During this step, it also extracts YAML configuration from the frontmatter to create the stylesheet and append links to the HTML file head;
2. Serves the HTML file locally on port 8080 using [http-server](https://github.com/http-party/http-server);
3. Navigates to the page using [puppeteer](https://pptr.dev/) and prints the PDF file through its headless Chromium browser.

Afterwards, it cleans up the temp folder created during the process.

## How can I contribute?

Thanks for the interest! Please, read the [CONTRIBUTING](CONTRIBUTING.md) file

## License

This project uses the classic MIT open-source license, which means you can use anything here for free for any commercial or non-commercial ends, but if you replicate parts of the code, the resulting project must also follow the same license.

It also means this software is provided "as is", with no warranty of any kind.

For more info, read [LICENSE.md](LICENSE.md)

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