Skip to content

avaer/img

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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');
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published