Skip to content

Commit 44e67b9

Browse files
committed
updated Readme.md and changed index.js require.
1 parent 1703b90 commit 44e67b9

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@ Its an **online programming ide** for the compilation of simple programs, Mostly
44
used in competitive programming servers to run the code according to certain set
55
of rules.
66

7+
## installation
8+
`npm install code-runner`
9+
10+
### additional dependencies
11+
1. To run `C` or `C++` code in the module you must have `gcc` installed in your system.
12+
2. To run `python` code you must have `python` installed in your system.
13+
14+
715
## usage
816

917
```javascript
1018
var runner = require('code-runner');
11-
runner(code,options,function(){
19+
runner(code,options,function(err,data){
1220
//callback function
1321
...
1422
});
@@ -19,3 +27,7 @@ runner(code,options,function(){
1927
1. `timeout` : time in ms, specifies the time after which the program must be
2028
terminated.
2129
2. `language` : the name of the language of the given code.
30+
* `err` is the error passed to the callback function if there is an error while calling the function.
31+
* `data` is the output passed to the callback function which contains the property
32+
1. `error` : error while executing the code.
33+
2. `total` : output of the code that ran.

index.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1 @@
1-
var runner = require("./modules/code-runner");
2-
// runner(
3-
// `#include <stdio.h>
4-
// int main(){
5-
// char s[5];
6-
// while(true);
7-
// return 1;
8-
// }`,
9-
// {
10-
// language: "C",
11-
// timeout:100
12-
// },
13-
// function(err, data) {
14-
// if (err) throw err;
15-
// console.log(data);
16-
// }
17-
// );
18-
module.exports = runner;
1+
module.exports = require("./modules/code-runner");

0 commit comments

Comments
 (0)