Makes building online compilers easy
npm install compileonMakes building online compilers easy.
compileon is a library written in node that helps you build online compilers and editors with ease.
node.js npm package manager. If you don't have node.js installed you can download it here```
$ npm install -g compileon
Note: The -g flag might require sudo permisson.
`javascript`
//if windows
var envData = { OS : "windows"};
//else
var envData = { OS : "linux" };
compiler.javaCompile( envData , code , function(data){
res.send(data);
});
Note: As compiling is same for Java in either of the OS can select either of the OS while using it.With Input:
`javascript`
//if windows
var envData = { OS : "windows"};
//else
var envData = { OS : "linux" };
compiler.compileWithInput( envData , code , input , function(data){
res.send(data);
});
2. For python, install python.
`javascript`
//if windows
var envData = { OS : "windows"};
//else
var envData = { OS : "linux" };
compiler.executePython( envData , code , function(data){
res.send(data);
});
Note: As compiling is same for Python in either of the OS can select either of the OS while using it.With Input:
`javascript`
//if windows
var envData = { OS : "windows"};
//else
var envData = { OS : "linux" };
compiler.executeWithInput( envData , code , input , function(data){
res.send(data);
});
3. For CPP and C, install g++ or gcc .
`javascript`
//if windows
var envData = { OS : "windows", cmd: "gcc" or "g++"};
//else
var envData = { OS : "linux", cmd: "gcc" or "g++"};
compiler.cppCompile( envData , code , function(data){
res.send(data);
});
Note: Can choose either gcc or g++.With Input:
`javascript``
//if windows
var envData = { OS : "windows", cmd: "gcc" or "g++"};
//else
var envData = { OS : "linux", cmd: "gcc" or "g++"};
compiler.cppcompileWithInput( envData , code , input , function(data){
res.send(data);
});