mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
19 lines
475 B
JavaScript
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);
|
|
}
|