minishouyin/node_modules/node-thermal-printer/examples/connected.js
2025-11-12 11:35:57 +08:00

15 lines
389 B
JavaScript

const ThermalPrinter = require('../node-thermal-printer').printer;
const Types = require('../node-thermal-printer').types;
async function testConnection () {
const printer = new ThermalPrinter({
type: Types.EPSON,
interface: process.argv[2],
});
const isConnected = await printer.isPrinterConnected();
console.log('Printer connected:', isConnected);
}
testConnection();