Last active
March 15, 2019 18:01
-
-
Save rybycy/ebba8b0e1bd0b874f7282f4dc5e68fa1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(RED) { | |
| var Xvfb = require('xvfb'); | |
| var xvfb = new Xvfb(); | |
| function StartXvfb(config) { | |
| RED.nodes.createNode(this, config); | |
| var node = this; | |
| node.on('input', function(msg) { | |
| xvfb.startSync(); | |
| node.send(msg); | |
| }); | |
| } | |
| function EndXvfb(config) { | |
| RED.nodes.createNode(this, config); | |
| var node = this; | |
| node.on('input', function(msg) { | |
| xvfb.end(function() {}); | |
| node.send(msg); | |
| }); | |
| } | |
| RED.nodes.registerType("start-xvfb", StartXvfb); | |
| RED.nodes.registerType("end-xvfb", StartXvfb); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment