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 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-gp-printer

v1.0.1

Published

当前使用 GP-5860III 打印机,其他型号支持ESC/POS的话应该都是可用的,以下是驱动安装说明

Downloads

4

Readme

一些说明

打印机的连接

当前使用 GP-5860III 打印机,其他型号支持ESC/POS的话应该都是可用的,以下是驱动安装说明

  1. 下载驱动 Zadig

  2. 解压后执行程序,如图顺序操作:

等待几分钟提示成功即可

开发一种小票需要以下步骤


/**
   * 打印商品销售小票
   * @param {*} data 
   */
  printGoodsell (data) {
    //获取定义的模板
    const template = require("./tickets/goods-sell")
    //打印
    this.printTemplate(this.loadTemplate(template, data))
  }
  1. 调用
new PrintHandler()
  .printGoodsell({
          ShopName: "测试店",
          TableColums: ["商品名", "单价", "数量", "金额"],
          ItemRows: [["叮当", "1.00", "2", "2.00"], ["哆啦A梦", "1.00", "2", "2.00"]],
          Should: "4.00",
          Discount: "1.00",
          Paid: "3.00",
          PayType: "现金",
          Mobile: "13800138000",
          ReMark: "",
          OrderNO: "S2328744283621783627846283422113",
          Employee: "张三",
          CreateTime: "2021-08-26 11:22:33"
  })

模板说明

格式说明

模板为一个json数组,每项对应小票中的一个数据集(一行或多行)

每项中的配置如下:

{
  type: "当前行的类型",
  key:"对应数据集合的键",
  style: {
    size: "字体大小,0-7,0为默认值",
    blob: "是否加粗",
    center: "是否居中"
  },
  title:"使用键值对作为一行的话,此为标题,value为值",
  value: "模板字符串,目前支持1个占位:{{}}"
}

type 对应说明:

{
  text:"一行文本",
  keyvalue:"键值对形式,如  “金额:       1.00”",
  row:"value设置一个数组,根据内容会均分一行",
  rows:"value为二维数组,对应datatable的行"
  line:"输出以“-----”这样的分割线",
  empty:"输出空行,可以理解为换行,value不设置的话默认换两行(即空1行)",
  ercode:"value为二维码内容",
  barcode:"value为条形码内容"
}