node-escpos / driver

🖨️ ESC/POS Printer driver for Node.js.
Other
309 stars 30 forks source link

feat: Added getDeviceBySerial function and outsourced isPrinter function #49

Closed dschweinbenz closed 1 year ago

dschweinbenz commented 1 year ago

Added getDeviceBySerial function which is necessary if multiple printers of the same manufacturer and model are present.

Outsourced isPrinter function for reusability. When listening on usb.on('attach', () => {}) it is useful to be able to reuse the isPrinter() function.

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: a58cc9b4a3fe33e892d788085cfce6f2e432032a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------------ | ----- | | @node-escpos/usb-adapter | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

dohooo commented 1 year ago

Cool! Thanks for your contribution! Could you add some tests for the code?