
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
zebra-browser-print-wrapper
Advanced tools
This package is a wrapper for the Zebra Browser Print and allows you to easily integrate your Zebra printers with web applications like (ReactJS).
Install the module in your project via YARN
yarn add zebra-browser-print-wrapper
Or NPM
npm i zebra-browser-print-wrapper
Return a list of the current available printers
Gets the current default printer
Sets the printer field
Returns the printer field
Returns an object indicating if the printer is ready and if not returns the error.
Returned object:
{
isReadyToPrint: boolean;
errors: string
}
Possible errors:
// Import the zebra-browser-prit-wrapper package
const ZebraBrowserPrintWrapper = require('zebra-browser-print-wrapper');
const printBarcode = async (serial) => {
try {
// Create a new instance of the object
const browserPrint = new ZebraBrowserPrintWrapper();
// Select default printer
const defaultPrinter = await browserPrint.getDefaultPrinter();
// Set the printer
browserPrint.setPrinter(defaultPrinter);
// Check printer status
const printerStatus = await browserPrint.checkPrinterStatus();
// Check if the printer is ready
if(printerStatus.isReadyToPrint) {
// ZPL script to print a simple barcode
const zpl = `^XA
^BY2,2,100
^FO20,20^BC^FD${serial}^FS
^XZ`;
browserPrint.print(zpl);
} else {
console.log("Error/s", printerStatus.errors);
}
} catch (error) {
throw new Error(error);
}
};
const serial = "0123456789";
printBarcode(serial);
FAQs
Zebra Browser Print Javascript Wrapper
The npm package zebra-browser-print-wrapper receives a total of 3,117 weekly downloads. As such, zebra-browser-print-wrapper popularity was classified as popular.
We found that zebra-browser-print-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
Company News
Socket’s acquisition of Coana brings best-in-class reachability analysis to application security teams globally, cementing Socket’s position as the leader in software supply chain security.