1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00
node-red-nodes/analysis/wordpos/72-wordpos.js
2016-11-06 20:26:19 +00:00

19 lines
475 B
JavaScript

module.exports = function(RED) {
"use strict";
var WordPos = require('wordpos');
var wordpos = new WordPos();
function WordPOSNode(n) {
RED.nodes.createNode(this,n);
this.on("input", function(msg) {
var node = this;
wordpos.getPOS(msg.payload, function (result) {
msg.pos = result;
node.send(msg);
});
});
}
RED.nodes.registerType("wordpos",WordPOSNode);
}