Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting the redis server by javascript?

How to run the redis by script, instead of manual start using "redis-server" ...

like image 205
Jai Avatar asked Jul 27 '26 20:07

Jai


1 Answers

As described in Execute a Unix Command with Node.js:

var sys = require('util')
var exec = require('child_process').exec;

function puts(error, stdout, stderr) {
    sys.puts(stdout)
}

exec("redis-server", puts); 
like image 191
kirilloid Avatar answered Jul 30 '26 10:07

kirilloid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!