0.1.0 • Published 6 years ago
datecs-fp700 v0.1.0
FP-700 fiscal printer via Node.js or Electron
This npm package contains a linux and mac executable files.
$ npm install datecs-fp700
$ yarn add datecs-fp700
// in node or electron
const fp700 = require('datecs-fp700');
// for example
const key = 90;
const argv = ['0x9']; // \t in hex
const cmd = argv.unshift(key);
// argv is array [0] is command in decimal notation.
// All other elements is string data in hex notation.
// For example "test\t" - [0x74, 0x65, 0x73, 0x74, 0x9]
// argv contains an array [90, 0x74, 0x65, 0x73, 0x74, 0x9]
fp700.exec('/dev/ttyUSB0', argv, (error, stdout, stderr) => {
if (error) {
console.log(error);
}
console.log('stderr:', stderr);
console.log('stdout:', stdout);
});