Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
zebra-browser-print-wrapper
Advanced tools
Readme
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 2,112 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.