New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

img

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

img

Convert any dom tree to an image element

3.0.3
latest
Source
npm
Version published
Weekly downloads
3.1K
34.16%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

image

FAQs

Package last updated on 25 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts