ZPL Direct Print with Deno (Raw ZPL Code)


Chris Brocklesby

This is a simple Deno script to print a ZPL code directly to a Zebra printer using Deno JS Runtime.

import net from "https://deno.land/std@0.152.0/node/net.ts";

const HOST = ""; // Zebra Printer IP
const PORT = 9100;

// Open ZPL Code Template
const zpl = await Deno.readFile("./templates/label.zpl");

const client = net.connect(PORT, HOST, () => {
  console.log("Printing labels...");

client.on("data", (data) => {
  console.log("socket.bytesRead is " + client.bytesRead);

client.on("end", () => {
  console.log("client disconnected");

Chris BrocklesbyHead of Technology, Software Engineer, Technology lover and Family man based in Mapua, Tasman in New Zealand (Originally from Swansea UK).