diff --git a/README.md b/README.md index b6ed710..bf9be23 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ a node.js library to print ptouch label on brother label printer. now tested on: * QL-820NWB +* QL-1110NWB ## Installation diff --git a/lib/index.js b/lib/index.js index fac5faa..df9f12c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -19,6 +19,13 @@ ptouch.prototype.insertData = function(objectName, value) { this.objects.push({objectName, value: Buffer.concat(buffers)}); }; +// Inserts Data from JSON converting keys into objectNames +ptouch.prototype.insertJSON = function( jsonDOC ) { + Object.keys(jsonDOC).forEach( (key) => { + this.insertData(String(key), String(jsonDOC[key])) + }); +} + ptouch.prototype.generate = function() { var data = []; data.push(CONSTANTS.PTOUCH_MODE);