A simple Node.js keylogger for Windows and macOS
Make sure you have node-gyp
and its dependencies installed
$ npm install keylogger.js
import keylogger from "keylogger.js";
// or
// const keylogger = require("keylogger.js");
keylogger.start((key, isKeyUp, keyCode) => {
console.log("keyboard event", key, isKeyUp, keyCode);
});
The key value returned with the callback function passed to keylogger.start
will match the browser's KeyboardEvent.key
value as listed in this table