Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/avaer/img


https://github.com/avaer/img

Last synced: 21 days ago
JSON representation

Awesome Lists containing this project

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

as an image and open the result in a new window
img($('

Please render this heading

')[0], function(img) {
window.open(img.src, '_blank');
});
```