https://github.com/maple3142/simple-judger
https://github.com/maple3142/simple-judger
judge node-module nodejs onlinejudge sandbox
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/maple3142/simple-judger
- Owner: maple3142
- License: mit
- Created: 2017-07-03T13:20:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-14T12:02:47.000Z (about 8 years ago)
- Last Synced: 2025-06-25T03:46:15.726Z (11 months ago)
- Topics: judge, node-module, nodejs, onlinejudge, sandbox
- Language: JavaScript
- Size: 139 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Simple Judger
================
A simple npm module to judge C/C++ program.(Linux only)
using [EasySandbox](https://github.com/daveho/EasySandbox) for safety judge
**[jsdoc link](https://maple3142.github.io/docs/simple-judger/)**
Install:
----------------
sudo? `npm install simple-judger`
Usage:
----------------
```javascript
var judge=require('simple-judger');
var options={
src: `#include
using namespace std;
......`, //code !REQUIRED!
in: '', //input string
out: '', //output string
timelimit: 1000, //ms !REQUIRED!
compile: 'g++ -o {out} {dest}', //compile command, {source} {out} will be replaced !REQUIRED!
result: { //result strings, these are default value
Accepted: 'AC',
Runtime_Error: 'RE',
Time_Limit_Exceeded: 'TLE',
Compile_Error: 'CE',
Wrong_Answer: 'WA',
System_Error: 'SE'
}
};
judge(options).then(result=>{
console.log(result);
});
```
Result Object:
----------------
```javascript
{
result: 'AC',
time: 10,
extra: 'Hello World'
//extra in different result represent different result
}
```
run `npm test` for testing
Installation Error:
----------------
if "permission denied" appear, add `sudo` then install again
others error please create a `Issue` on github