node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

lpd

Limitations

I've only implemented the tiny subset of LPD that I've needed. Pull requests welcome.

LPDServer

{LPDServer} = require 'lpd'

server = new LPDServer
server.listen PORT, () -> console.log "Listening on #{PORT}..."
server.on 'job', ({controlFile, dataFile}) ->

sendLPDJob

{sendLPDJob} = require 'lpd'

sendJob {
  host:         "..."
  controlFile:  ...Buffer...
  dataFile:     ...Buffer...
  515:          # default: 515
  verbose:      # default: false
  jobDigits:    # default: random 3-digit job number string
  jobHost:      # default: random token
}, (e) ->

Example

{sendLPDJob} = require 'lpd' 
{tsp100} = require 'lpd-printers'
sendLPDJob {
  host: '192.168.0.123'
  controlFile: tsp100.controlFile,
  dataFile: tsp100.dataFileForP4(pbm_p4),
}, (e) ->