Merge branch 'hotfix/fix_printer_object'

This commit is contained in:
Jay 2017-08-23 21:24:04 +08:00
commit f0b11a90c2

5
app.js
View File

@ -31,6 +31,7 @@ bleno.on('advertisingStart', function (error) {
})
localEvent.on('print', async (str) => {
console.log(`get printer string >>> \n${str}`)
let status = false
if (printer.isOpen) {
try {
@ -41,4 +42,8 @@ localEvent.on('print', async (str) => {
}
localEvent.emit('printResult', status)
})
process.on('SIGINT', () => {
printer.close()
})