Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🖨️ ESC/POS Printer driver for Node.js

License

NotificationsYou must be signed in to change notification settings

lsongdev/node-escpos

Repository files navigation

ESC/POS Printer driver for Node.js

npm versionBuild Status

NPM

Packages Available:

Example

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.

Screencast

img_1031


Contributing

  • 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

Contributors

Thanks to ourcontributors 🎉👏


MIT license

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.



[8]ページ先頭

©2009-2025 Movatter.jp