Its an online programming ide for the compilation of simple programs, Mostly used in competitive programming servers to run the code according to certain set of rules.
npm install code-runner
- To run
CorC++code in the module you must havegccinstalled in your system. - To run
pythoncode you must havepythoninstalled in your system.
var runner = require('code-runner');
runner(code,options,function(err,data){
//callback function
...
});codeis the code to be executed.optionsis an object which should contain the following properties :timeout: time in ms, specifies the time after which the program must be terminated.language: the name of the language of the given code.
erris the error passed to the callback function if there is an error while calling the function.datais the output passed to the callback function which contains the propertyerror: error while executing the code.total: output of the code that ran.