{"size": 676, "ext": "js", "max_stars_repo_path": "parser/x3g_parser.js", "max_stars_repo_name": "sergekeyser/x3g-nodered", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "parser/x3g_parser.js", "max_issues_repo_name": "sergekeyser/x3g-nodered", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "parser/x3g_parser.js", "max_forks_repo_name": "sergekeyser/x3g-nodered", "max_forks_repo_forks_event_min_datetime": "2018-12-25T07:14:23.000Z", "max_forks_repo_forks_event_max_datetime": "2018-12-25T07:14:23.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 39.7647058824, "max_line_length": 129, "alphanum_fraction": 0.6568047337}
module.exports = function(RED) {
    function x3gParserNode(config) {
        RED.nodes.createNode(this,config);
	var node = this;
	var x3gParser = require('./x3g_functionarray.js')
        this.on('input', function(msg) {
		var context = this.context();
            	var buffer = new Buffer(msg.payload.data,'base64');
		this.status({fill:"yellow",shape:"dot",text:"Busy Parsing"});
		msg.payload = {"name":msg.payload.name,"printerid":msg.payload.printerid,"parseddata":x3gParser.getProcessingFunction(buffer)};
		this.status({fill:"green",shape:"ring",text:"Ready"});	
            	node.send(msg);
        });
    }
    RED.nodes.registerType("X3GParser",x3gParserNode);
}
