Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avaer/img
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/avaer/img
- Owner: avaer
- Created: 2016-03-23T05:07:56.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-25T16:17:18.000Z (almost 9 years ago)
- Last Synced: 2024-10-27T16:31:15.342Z (2 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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');
});
```