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

universal-printer

v0.9.5

Published

本插件用于调用江苏国光公司凭条打印机C++版本打印dll

Downloads

14

Readme

# universal-printer

#### 介绍
本插件用于调用江苏国光公司凭条打印机C++版本打印dll

#### 软件架构
本项目基于NAPI技术
依赖于nodejs运行时环境


#### 安装教程

1.  安装依赖

`npm install universal-printer`


2.  在需要使用的js中引入插件

eg:

let addon= require('universal-printer'); result = addon.initDevice(true); console.log(result);


3.  运行

`node test.js`


#### 使用说明

本插件提供以下接口:
+ initDevice(isDebug)  初始化设备(每个打印任务都需要调用此方法)
	+ isDebug   boolean   是否返回日志信息
+ closeDevice() 关闭设备(每个打印任务都需要调用此方法)
+ getDeviceStatus() 获取设备状态
+ setLineSpace(lineSpace)  设置行间距
	+ lineSpace Number    行间距
+ setLeftSpace(leftSpace) 设置左边距
	+ leftSpace Number    左边距
+ setAlign(type) 设置居中
	+ type      Number 
+ setPrintFont(font, doubleHeight, doubleWidth, underLine, bold) 设置字体
	+ font          Number   0-正常 1-压缩
	+ doubleHeight  Number   0-正常 1-倍高
	+ doubleWidth   Number   0-正常 1-倍宽
	+ underLine     Number   0-正常 1-下划线
	+ bold          Number   0-正常 1-加粗
+ feedLines(lines)  填充行
	+ lines     Number   行数
+ printString(content, autoEnter)  打印字符串
	+ content   string   内容
	+ autoEnter boolean  自动换行
+ printCode128(content)  打印条形码
	+ content    string    内容
+ printQR(content)  打印二维码
	+ content    string    内容
+ cutPaper()  切纸
+ printLog(log, logName)  打印日志
	+ log        string    内容
	+ logName		 string    日志文件名,默认为当前日期
+ printLog(log, logName)  打印日志
	+ log        string    内容
	+ logName		 string    日志文件名,默认为当前日期
+ printTestPaper()  打印测试页