Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

DEPRECATED This is a node package which facilitates in compiling and running languages including java,c,c++,python and node. This can be used to create web services like online IDE's

License

vibhor1997a/compile-run-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED

This is no longer maintained and is completely rewritten. So you can use compile-run v2.x.x which is moved to https://github.com/l-ide/compile-run. You can still install it from the older versions from the NPM but we recommend using the better, cross-platform version instead avaliable at the above link.

This is a node package which facilitates in compiling and running languages including java,c,c++,python and node. This can be used to create web services like online IDE's.

This package compiles the input code, takes stdin and gives stdout/stderr after the compilation on the host. This requires the compilers from the above languages to be installed for this package to function

Supported Languages

Language Support
C
C++
Java
Python
Node.js

Prerequisites

The following should be installed on your machine and their paths should be set(in case of windows machine).

Language Software
C gcc
C++ gcc
Java jdk or jre
Python python 3
Node.js node.js

This package requires access to file system to create directories to store source files.

Documentation

Compile and Run File

var compile_run = require('compile-run');
    compile_run.runFile('./temp/script.py',stdin,function(stdout,stderr,err){
       if(!err){
       console.log(stdout);
        console.log(stderr);
        }
        else{
        console.log(err);
        }
    
    });

Compile and Run code

1) Run Node

var compile_run = require('compile-run');
    compile_run.runNode(code, input, function (stdout, stderr, err) {
       if(!err){
       console.log(stdout);
        console.log(stderr);
        }
        else{
        console.log(err);
        }
    });
});

2) Run C

var compile_run = require('compile-run');
    compile_run.runC(code, input, function (stdout, stderr, err) {
       if(!err){
       console.log(stdout);
        console.log(stderr);
        }
        else{
        console.log(err);
        }
    });
});

3) Run Cpp

var compile_run = require('compile-run');
    compile_run.runCpp(code, input, function (stdout, stderr, err) {
       if(!err){
       console.log(stdout);
        console.log(stderr);
        }
        else{
        console.log(err);
        }
    });
});

4) Run Python

var compile_run = require('compile-run');
    compile_run.runPython(code, input, function (stdout, stderr, err) {
       if(!err){
       console.log(stdout);
        console.log(stderr);
        }
        else{
        console.log(err);
        }
    });
});

5) Run Java

var compile_run = require('compile-run');
    compile_run.runJava(code, input, function (stdout, stderr, err) {
       if(!err){
       console.log(stdout);
        console.log(stderr);
        }
        else{
        console.log(err);
        }
    });
});

About

DEPRECATED This is a node package which facilitates in compiling and running languages including java,c,c++,python and node. This can be used to create web services like online IDE's

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published