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

@eyelly/print

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eyelly/print

A simple function for partial printing on the browser

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Print

Print is a simple function for partial printing on the browser

Installation

NPM

npm i -S @eyelly/print

CDN

<script src='https://unpkg.com/@eyelly/print/dist'></script>

Usage & Example

In Module

import print from '@eyelly/print'

const fooDom = document.getElementById('xxx')
print({
  content:fooDom
})

In HTML

<!DOCTYPE html>
<html lang="en">

  <head>
    <script src='https://unpkg.com/@eyelly/print/dist'></script>
  </head>

  <body>
    <div id='content'> this is content to print </div>
    <div> this is normal content </div>
    <button id='button1'>normal print</button>
    <button id='button2'>new window print</button>
    <script>
      const content = document.getElementById('content')
      const button1 = document.getElementById('button1')
      const button2 = document.getElementById('button2')

      button1.addEventListener('click', () => {
        print({
          content
        })
      })

      button2.addEventListener('click', () => {
        print({
          content,
          newWindow: true,
          title: 'print example'
        })
      })
    </script>
  </body>

</html>

API

PropertyDescriptionTypeDefault
contentcontent to be printedHTMLElement-
newWindowopen a new window to printbooleanfalse
titlethe title of the newly opened windowboolean-

License

MIT

Keywords

FAQs

Package last updated on 21 Sep 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc