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

19 lines
475 B
JavaScript
Raw Normal View History

2013-10-30 21:38:23 +01:00
module.exports = function(RED) {
"use strict";
var WordPos = require('wordpos');
var wordpos = new WordPos();
2013-10-30 21:38:23 +01:00
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);
2013-10-30 21:38:23 +01:00
}