
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
labelstudio-js-client
Advanced tools
Small JavaScript client for your custom LabelStudio service.
npm i labelstudio-js-client
import LabelStudio from 'labelstudio-js-client';
await LabelStudio.configure({
baseUrl: 'http://localhost:3966',
preferredPrinters: ['DYMO LabelWriter 450', 'DYMO']
}).init();
const printers = await LabelStudio.getPrinters();
LabelStudio.setPrinter(printers[0]);
LabelStudio.setLabel('dymo.address.30252');
const label = new LabelStudio.Label();
label
.addText('Order #100045', {
left: 60,
top: 70,
width: 500,
height: 80,
fontSize: 40,
textAlign: 'left',
autoFit: false
}).done()
.addText('Property of SecureErase, LLC', {
left: 150,
top: 220,
width: 540,
height: 70
}).align('center').autoFit(true, { width: 540, height: 70 }).done()
.addBarcode('0192-XY-445901').dimensions(780, 190).at(55, 130).done()
.addQrCode('https://example.com/track/INV-100045').size(240).at(40, 20).done();
await LabelStudio.print(label, { copies: 2 });
LabelStudio.configure(options)LabelStudio.init()LabelStudio.getPrinters()LabelStudio.getLabels()LabelStudio.setPrinter(name)LabelStudio.setLabel(labelId)LabelStudio.print(labelOrDesign, options?)LabelStudio.printBulk(labelsOrDesigns, options?)LabelStudio.renderTemplate(template, data)LabelStudio.convertJsonToJs(payload, options?)new LabelStudio.Label()new LabelStudio.Lable() is also supported as an alias.
Element builder methods work for text/barcode/qr/image and return to label with .done():
.at(left, top).size(value).dimensions(width, height).scale(x, y?).color(fill).font(family).weight(fontWeight).align('left' | 'center' | 'right').autoFit(enabled, { width?, height? }).options(object)Label methods:
addText(text, options?)addBarcode(data, options?)addQrCode(data, options?)addImage(src, options?)addObject(object)toJSON()Convert a JSON payload into builder-style JavaScript:
const payload = {
printer: 'DYMO LabelWriter 450',
label: 'dymo.address.30252',
objects: [
{
type: 'textbox',
text: 'Order #100045',
left: 60,
top: 70,
width: 500,
height: 80,
fontSize: 40,
textAlign: 'left',
autoFit: false
},
{ type: 'barcode', barcodeType: 'code128', barcodeData: '0192-XY-445901', left: 55, top: 130 }
]
};
const code = LabelStudio.convertJsonToJs(payload, { includePrintCall: true });
console.log(code);
Common failure cases now throw explicit errors:
ServiceUnavailableError: backend service is not reachable.DiscoveryError with code NO_PRINTERS: no printers discovered.DiscoveryError with code NO_LABELS: no labels discovered.FAQs
Small JavaScript client for the custom LabelStudio service
We found that labelstudio-js-client demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.