Read the statement by Michael Teeuw here.
Parsing stdout into a module for display
-
Is anyone able to provide an example of a simple module that can parse/display a printf output on the mirror? I’m trying to do this but really struggling to understand how to. I can use fprintf to get to a file but that’s not much help to me either.
Ideally I would like to printf a value that will then be displayed in my module on the mirror…
-
@darrene in the node_helper you can do something like that
const spawn = require('child_process').spawn; const ls = spawn('ls', ['-lh', '/usr']); ls.stdout.on('data', (data) => { console.log(`stdout: ${data}`); }); ls.stderr.on('data', (data) => { console.log(`stderr: ${data}`); }); ls.on('close', (code) => { console.log(`child process exited with code ${code}`); });https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options
-
Thanks so much @strawberry-3.141, that’s just what I needed to set me in the right direction. I’ll do a bit of reading and follow this approach,. I’ll be sure to post how I get on :)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login