
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
A module created to help with printing elements on an html page in an easy and intuative way.
Originally forked from print-html-element continue development.
This fork's main improvement is the use of typescript over vanilla js. I will continue to itterate over this to add the intended 'future functionality' of the original author.
View examples here
Print HTML Element is available on both NPM and Bower.
npm install printerjs
yarn install printerjs
In a CommonJS module system via Browserify or Webpack
var PHE = require("printerjs");
or (ES)
import printer from "printerjs";
Good old-fashioned way
<script type="text/javascript" src="printer.js"></script>
// Alias global variable printHtmlElement for purposes of example
var printer = ElementPrinter;
View examples here
printer.printElement( document.getElementById('toPrint') );
printer.printHtml('<h1>Let\'s print this h1</h1>');
printer.printHtml('<h1>Let\'s print this h1</h1>', {templateString: '<header>I\'m part of the template header</header>{{printBody}}<footer>I\'m part of the template footer</footer>'});
An HTML class pe-body is also added to the body of the print area which can be used as an additional style hook (on top of the regular print media query/stylesheet)
opts = {
printMode: string;
pageTitle: string;
templateString: string;
popupProperties: string;
closePopup: boolean;
stylesheets: string | string[];
styles: string | string[];
};
printer.printElement( elem, opts ); // Prints a DOM Element
printer.printHtml( str, opts ); // Prints an HTML string
iframe (default), or popup window{{printBody}} within the template to signify where the HTML should be injectedmenubar, scrollbars, etc. in popup modelink tags and instead injects link tags with hrefs specified as either a single string or array of stringsstyle tags and instead injects style blocks specified as either a single string or array of stringsprinterjs is MIT licensed
FAQs
Prints the HTML of a provided element.
The npm package printerjs receives a total of 7 weekly downloads. As such, printerjs popularity was classified as not popular.
We found that printerjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.