# dom-printer

> DOM printer

Latest version **2.2.0** (published 2021-07-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install dom-printer
pnpm add dom-printer
yarn add dom-printer
bun add dom-printer
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2021-07-28 |
| First published | 2019-12-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 53.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | yinliguo |
| Maintainers | yinliguo |
| Keywords | dom, printer |

## Links

- npm: https://www.npmjs.com/package/dom-printer
- Repository: https://github.com/yinliguo/printer
- Homepage: https://github.com/yinliguo/printer#readme
- Issues: https://github.com/yinliguo/printer/issues
- npm.io page: https://npm.io/package/dom-printer

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.2.0 (latest) — 2021-07-28
- 2.1.0 — 2019-12-24
- 2.0.0 — 2019-12-19
- 1.0.1 — 2019-12-15

## README

# Printer
![npm](https://img.shields.io/npm/v/dom-printer)
![browser](https://img.shields.io/badge/Browsers-Chrome%2C%20IE9--11%2C%20Edge%2C%20Safari%2C%20Firefox-green)

Printer for browsers.

### Usage
````
import Printer from "dom-printer";

const p = new Printer();
p.append(document.getElementById('first-page'));
p.split();
p.append(document.getElementById('second-page'));
p.print();
````

### Constructor Parameters
Name        | Type                              | Attributes  | Description
------------|-----------------------------------|-------------|-----------------
content     | Element, HTMLCollection, NodeList | <optional\> | Content for print
importCSS   | Boolean                           | <optional\> | Import style of current page or not. The default is true
style       | String                            | <optional\> | Custom style. The default is ''
preview     | Boolean                           | <optional\> | Preview instead of print. The default is false

### Methods
* `print()` Print action
* `append(elem: Element | HTMLCollection | NodeList, clone: boolean = true)` Append element
* `splitPage()` Split page
* `clear()` Clear content
* `destroy()` Destroy printer instance

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