0.1.1 • Published 5 years ago
nodejs-ipp-printer v0.1.1
nodejs-ipp-printer
A simple ipp printer written in node.js.
This project is heavily inspired by Thomas Watson. Check out his ipp-printer.
This package should to be used in production yet.
Installation
Install locally:
$ npm install ipp-printer --save
Usage
const fs = require('fs');
const Printer = require('nodejs-ipp-printer').Printer;
const printer = new Printer();
printer.on('job', (job) => {
const wStream = fs.createWriteStream(`./job-${job.jobId}.ps`);
job.pipe(wStream);
job.on('finish', () => {
console.log('Successfully saved file.');
});
});
Examples
To run savePsFile.js run the following command from the root folder:
$ npx babel-node examples/savePsFile.js
Debugging
nodejs-ipp-printer uses the following package for https://github.com/visionmedia/debug#readme
The easiest way to enble debugging logs is by prefixing the execution comman with $ DEBUG=*
ex. $ DEBUG=* npm start