Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ a node.js library to print ptouch label on brother label printer.
now tested on:

* QL-820NWB
* QL-1110NWB

## Installation

Expand Down
7 changes: 7 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down