Hi, yes I could advice myself what he wrote, anyway the module works, it just hang NR from quit. It's highly probable that a little correction will fix the problem, I'm asking here if someone kindly can advice whrere the problem is. Unfortunately there aren't other nodes that can read `cat /dev/input/event0
I post the code here:
JSON:
{
  "name": "node-red-contrib-dev-input",
  "version": "0.0.1",
  "description": "Basic Node-Red node for use in /dev/input/event reading.",
  "main": "dev-input.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/MattGyver/node-red-contrib-dev-input.git"
  },
  "keywords": [
    "node-red",
    "input",
    "event",
    "hid"
  ],
  "node-red": {
    "nodes": {
      "devinput": "dev-input.js"
    }
  },
  "author": "Mattias Nord",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/MattGyver/node-red-contrib-dev-input/issues"
  },
  "homepage": "https://github.com/MattGyver/node-red-contrib-dev-input#readme"
}
HTML:
<script type="text/javascript">
    RED.nodes.registerType('dev-input',{
        category: 'input',
        color: '#a6bbcf',
        defaults: {
            name: {value:""},
            device: {valie:""}
        },
        inputs:0,
        outputs:1,
        icon: "file.png",
        label: function() {
            return this.name||"dev-input";
        }
    });
</script>
<script type="text/x-red" data-template-name="dev-input">
    <div class="form-row">
        <label for="node-input-name"><i class="icon-tag"></i> Name</label>
        <input type="text" id="node-input-name" placeholder="Name">
    </div>
    <div class="form-row">
        <label for="node-input-device"><i class="icon-tag"></i> Device</label>
        <input type="text" id="node-input-device" placeholder="/dev/input/event0">
    </div>
</script>
<script type="text/x-red" data-help-name="dev-input">
    <p>A simple node that reads specified /dev/input event and forward the event data in msg.payload.</p>
</script>
JS:
module.exports = function(RED) {
  var msg = { topic:"dev-input" }
  function parseBuffer( buffer ) {
    var eventObject = {};
    eventObject.code   = buffer[12];
    return eventObject;
  }
  function DevInput(config) {
    RED.nodes.createNode(this,config);
    var node = this;
    if (config.device != undefined) {
      var FS = require('fs');
      if (!FS.existsSync(''+config.device)) {
        throw "Can't find device.";
      }
      FS.createReadStream(''+config.device).on('data', function( buffer ) {
        msg.payload = parseBuffer(buffer)
        node.send(msg);
      });
    }
  }
  RED.nodes.registerType("dev-input",DevInput);
}
Thank you a lot