<commit_before>'use strict';

const path = require('path');
const npus = require("..");

const filename = process.argv[2] || path.resolve(__dirname, 'fixtures', 'doc.pdf');
const printerName = process.argv[3];

console.log('platform:', process.platform);
console.log('try to print file: ' + filename);

const printer = npus.getPrinter(printerName);
printer.start();
printer.on('job:complete', (job) => {
	console.log(`JOB "${job.fullid}" completed`);
	printer.stop();
});
printer.printFile(filename).then(job => {
	console.log("sent to printer with ID: " + job.id);
	console.log(job.status);
}).catch(err => {
	console.error(err);
});<commit_msg>Refactor<commit_after>'use strict';

const path = require('path');
const npus = require("..");

const printerName = process.argv[2];
const filename = process.argv[3] || path.resolve(__dirname, 'fixtures', 'doc.pdf');

console.log('platform:', process.platform);
console.log('try to print file: ' + filename);

const printer = npus.getPrinter(printerName);
printer.start();
printer.on('job:complete', (job) => {
	console.log(`JOB "${job.fullid}" completed`);
	printer.stop();
});
printer.printFile(filename, {options: {copies: 2}}).then(job => {
	console.log("sent to printer with ID: " + job.id);
	console.log(job.status);
}).catch(err => {
	console.error(err);
});
{'fraction_non_alphanumeric': 0.20976353928299007, 'fraction_numerical': 0.0038138825324180014, 'mean_word_length': 5.905263157894737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6920524', 'n_tokens_mistral': 443, 'n_tokens_neox': 441, 'n_words': 91}