diff --git a/adapter/serial.js b/adapter/serial.js index ea9b67f..6c1a94f 100644 --- a/adapter/serial.js +++ b/adapter/serial.js @@ -1,7 +1,6 @@ 'use strict'; const util = require('util'); const EventEmitter = require('events'); -const SerialPort = require('serialport'); /** * SerialPort device @@ -14,6 +13,7 @@ function Serial(port, options){ baudRate: 9600, autoOpen: false }; + const SerialPort = require('serialport'); this.device = new SerialPort(port, options); this.device.on('close', function() { self.emit('disconnect', self.device); diff --git a/package.json b/package.json index 7220b14..e5f06af 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "ESC/POS Printer driver for nodejs", "main": "index.js", "scripts": { - "test": "mocha" + "test": "mocha", + "start": "node server.js" }, "repository": { "type": "git", @@ -14,11 +15,7 @@ "escpos", "printer" ], - "author": { - "name": "Lsong", - "email": "hi@lsong.org", - "url": "https://lsong.org" - }, + "author": "Lsong (https://lsong.org)", "contributors": [ "Jose Vera ", "Sébastien Vidal ", @@ -33,14 +30,14 @@ }, "homepage": "https://github.com/song940/node-escpos#readme", "dependencies": { + "qr-image": "*", + "get-pixels": "*", "iconv-lite": "*", "mutable-buffer": "^2.0.3" }, "optionalDependencies": { - "get-pixels": "*", - "serialport": "*", - "qr-image": "*", "usb": "*", + "serialport": "*", "node-bluetooth": "*" }, "devDependencies": { @@ -48,5 +45,10 @@ }, "engines": { "node": ">=8.x" + }, + "directories": { + "doc": "docs", + "example": "examples", + "test": "test" } }