
Security News
Feross on Risky Business Weekly Podcast: npm’s Ongoing Supply Chain Attacks
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
@tillpos/xml-escpos-helper
Advanced tools
Originally forked from here
Cross platform JavaScript library that implements the thermal printer ESC / POS protocol and provides an XML interface for preparing templates for printing.
yarn add @tillpos/xml-escpos-helper
import { EscPos } from '@tillpos/xml-escpos-helper';
// store this template somewhere `s3` or as `static asset` based on your preference
const template = `
<?xml version="1.0" encoding="UTF-8"?>
<document>
<align mode="center">
<bold>
<text-line size="1:0">{{title}}</text-line>
</bold>
</align>
{{#thankyouNote}}
<align mode="center">
<text-line size="0:0"> {{{thankyouNote}}}</text-line>
</align>
<line-feed />
<paper-cut />
</document>
`;
const input = {
title: 'Sample',
thankyouNote: 'Welcome...!'
};
const buffer = EscPos.getBufferFromTemplate(template, input);
// send this buffer to a stream (eg.: bluetooth or wifi)
const template = `<?xml version="1.0" encoding="UTF-8"?>
<document>
<align mode="center">
<bold>
<text-line size="1:0">{{title}}</text-line>
</bold>
<image density="d24">
{{base64PngImage}}
</image>
</align>
</document>`;
const input = {
title: 'PNG - base64',
base64PngImage: `data:image/png;base64,iVBORw0KGgoAAA+P/AaNn2GPEMgEFAAAAAElFTkSuQmCC`
};
const buffer = EscPos.getBufferFromTemplate(template, input);
Limitations on the react-native framework
Contributions of any kind welcome! :heart:
FAQs
ESC/POS with XML interface
We found that @tillpos/xml-escpos-helper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.