New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

command-printer

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

command-printer

A simple JavaScript command print tools.

latest
npmnpm
Version
1.0.8
Version published
Maintainers
1
Created
Source

command-printer

js command print.support TSPL,ZPL,ESC,CPCL NPM version NPM downloads

Install

npm install command-printer --save

Usage

const {Tspl} = require('command-printer');
const tspl = new Tspl({
    charSet: 'utf8',
    printCount:1
});
tspl.setPage(70,40,0,3,0);// page width,page height,direction,gap m,gap n
tspl.addText(10,10,'Hello World!','TTS24',0,2);// x,y,text,font,direction,scale
tspl.addImage('test.png',10,20);// image url,X,Y
tspl.getPrintData(); // Hex string

API

class Tspl {
    constructor(options)
    setPage(width, height, direction, gapM, gapN)
    addText(x, y, text, font, direction, scale)
    addImage(url, x, y)
    addImageByBytes(imageBitData, x = 0, y = 0,width, height)
    addBitmap(bitmap,x, y, width, height)
    addBlock(x, y, width, height,font,rotation,text,scale,lineSpace)
    addBar(x, y, width,height)
    addBox(startX,startY,endX,endY,lineThickness,radius)
    addBarcode(x, y, type, height, content, showLabel, widetWidth,narrowWidth, rotate)
    addQrcode(x, y, text, cellwidth, rotation, eccLevel)
    getPrintData()
}
class Zpl {
    constructor(options)
    setPage(width, height, direction, gapM, gapN)
    addText(x, y, text, font, direction, scale)
    addImage(url, x, y)
    addBitmap(bitmap,x, y, width, height)
    addBlock(x, y, width, height,font,rotation,text,scale,lineSpace)
    addBar(x, y, width,height)
    addBox(startX,startY,endX,endY,lineThickness,radius)
    addBarcode(x, y, type, height, content, showLabel, widetWidth,narrowWidth, rotate)
    addQrcode(x, y, text, cellwidth, rotation, eccLevel)
    getPrintData()
}
class Esc {
    constructor(options)
}
class Cpcl {
    constructor(options)
}

License

MIT

FAQs

Package last updated on 01 Dec 2025

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