1.0.0 • Published 2 years ago

node-printer-all v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

NODE PRINTER ALL

Node.js module for thermal printers.

🔗 node-thermal-printer 🔗 node-printer

Installation

$ npm install node-printer-all

or

$ yarn add node-printer-all

Features

const Printer =  require("node-printer-all");

let print = Printer(
    {
        type: PrinterTypes.STAR,                                  // Printer type: 'star' or 'epson'
        interface: 'tcp://xxx.xxx.xxx.xxx',                       // Printer interface
        characterSet: 'SLOVENIA',                                 // Printer character set - default: SLOVENIA
        removeSpecialCharacters: false,                           // Removes special characters - default: false
        lineCharacter: "=",                                       // Set character for lines - default: "-"
        options:{                                                 // Additional options
            timeout: 5000                                           // Connection timeout (ms) [applicable only for network printers] - default: 3000
        }
    }
)

or

import {Printer} from "node-printer-all";

let print = Printer(
    {
        type: PrinterTypes.STAR,                                  // Printer type: 'star' or 'epson'
        interface: 'tcp://xxx.xxx.xxx.xxx',                       // Printer interface
        characterSet: 'SLOVENIA',                                 // Printer character set - default: SLOVENIA
        removeSpecialCharacters: false,                           // Removes special characters - default: false
        lineCharacter: "=",                                       // Set character for lines - default: "-"
        options:{                                                 // Additional options
            timeout: 5000                                           // Connection timeout (ms) [applicable only for network printers] - default: 3000
        }
    }
)

To understand more about the functions access node-thermal-printer

How to run examples

Network printer

node examples/example.js tcp://xxx.xxx.xxx.xxx

Pritner name via Printer module

node examples/example.js 'printer:My Printer'

Local port or file

node examples/example.js '\\.\COM1'