# img

> Convert any dom tree to an image element

Latest version **3.0.3** (published 2016-03-25) · ISC license · 0 weekly downloads

## Install

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

## 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 | 3.0.3 |
| Published | 2016-03-25 |
| First published | 2014-06-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | a@modules.io |
| Maintainers | kazmer |
| Keywords | image, element, dom, tree, render, canvas |

## Links

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

## 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

- 3.0.3 (latest) — 2016-03-25
- 0.0.1-security — 2016-03-23
- 3.0.2 — 2016-03-23
- 3.0.1 — 2016-03-23
- 3.0.0 — 2016-03-22
- 1.0.0 — 2014-10-25
- 0.0.1 — 2014-06-23
- 0.0.0 — 2014-06-23

## README

Convert any dom tree to an image element.

```
const img = require('img');

// create a rendered image of the DOM element with id 'my-element' and attach it to the end of the document
img($('#my-element')[0], function(img) {
  document.body.appendChild(img);
});

// create a rendered <h1> as an image and open the result in a new window
img($('<h1>Please render this heading</h1>')[0], function(img) {
  window.open(img.src, '_blank');
});
```

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