- Notifications
You must be signed in to change notification settings - Fork423
🖨️ ESC/POS Printer driver for Node.js
License
lsongdev/node-escpos
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ESC/POS Printer driver for Node.js
Packages Available:
- escpos Printer
- escpos Screen Display
- escpos USB Adapter
- escpos Network Adapter
- escpos Bluetooth Adapter
- escpos SerialPort Adapter
constescpos=require('escpos');// install escpos-usb adapter module manuallyescpos.USB=require('escpos-usb');// Select the adapter based on your printer typeconstdevice=newescpos.USB();// const device = new escpos.Network('localhost');// const device = new escpos.Serial('/dev/usb/lp0');constoptions={encoding:"GB18030"/* default */}// encoding is optionalconstprinter=newescpos.Printer(device,options);device.open(function(error){printer.font('a').align('ct').style('bu').size(1,1).text('The quick brown fox jumps over the lazy dog').text('敏捷的棕色狐狸跳过懒狗').barcode('1234567','EAN8').table(["One","Two","Three"]).tableCustom([{text:"Left",align:"LEFT",width:0.33,style:'B'},{text:"Center",align:"CENTER",width:0.33},{text:"Right",align:"RIGHT",width:0.33}],{encoding:'cp857',size:[1,1]}// Optional).qrimage('https://github.com/song940/node-escpos',function(err){this.cut();this.close();});});
- See
./examples
for more examples.
- Fork this repo
- Clone your repo
- Install dependencies
- Checkout a feature branch
- Feel free to add your features
- Make sure your features are fully tested
- Open a pull request, and enjoy <3
Thanks to ourcontributors 🎉👏
Copyright (c) 2015 ~ now Lsonghi@lsong.org
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.
About
🖨️ ESC/POS Printer driver for Node.js