npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

loveyyao-print

v1.0.1

Published

web端 PDF、图片等打印插件方案

Downloads

18

Readme

LoveyyaoPrint web打印

该打印依赖于loveyyao-print打印服务,使用先下载安装loveyyao-print打印服务。loveyyao-print详情查看。 服务启动后将自动连接,连接成功后可以使用。目前支持jpg, png, pdf等格式打印,后续会持续更新。 切勿用于生产环境。

安装

npm i loveyyao-print

使用

import loveyyaoPrint from 'loveyyao-print'

Vue.use(loveyyaoPrint)

属性

  • socketsocket.io-client对象
  • printerList:打印机列表
  • clientInfo:服务端信息
  • connected:连接状态

方法

  • getPrinterList() => Promise<Array>
  • refreshPrinterList() => Promise<Array>
  • print(optins) => Promise<undefined>

options

  • {string} options.printer - 将文件发送到指定的打印机
  • {string} options.pages - 指定要打印 PDF 文档中的哪些页面
  • {string} options.subset - 仅当值为 时打印奇数页odd,仅当值为 时打印偶数页even
  • {string} options.orientation - 提供内容 90 度旋转(不是纸张旋转,纸张旋转必须通过选择打印机默认值进行预设)。
  • {string} options.scale - 支持的名称有noscaleshrink、 和fit
  • {boolean} options.monochrome - 以黑白方式打印文档。默认值为false
  • {string} options.side - 支持的名称有duplexduplexshortduplexlongsimplex
  • {string} options.bin - 选择要打印到的纸盘。号码或姓名。
  • {string} options.paperSize - 指定纸张尺寸。A2、A3、A4、A5、A6、letter、legal、tabloid、statement或可从打印机设置中选择的名称。
  • {boolean} options.silent - 使错误消息静音。
  • {boolean} options.printDialog - 显示此命令行上指示的所有文件的打印对话框。
  • {number} options.copies - 指定要打印的份数。
  • {string} options.type - jpg, png, pdf(必填)
  • {string} options.url - 文件路径(必填)
  • {string} options.name - 文件名(可选)