0.1.3 • Published 7 years ago

sphere-engine v0.1.3

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

Sphere Engine Node API

Sphere Engine API npm package

Installation

$ npm i --save sphere-engine

Usage

const Sphere = require('sphere-engine')

const sphere = new Sphere({
    endpoint: '<HASH>.compilers.sphere-engine.com',
    token: '<COMPILER_API_TOKEN>'
});

const code = `
#include <iostream>
using namespace std;
int main () {    
    cout << "Hello Sphere";
    return 0;
}
`

sphere.ready(() => {

    sphere.compile({
        language: 'c++',
        source: code
    }, 1000).then(response => {

        console.log(response)
        // Console logs
        // {
        //    id: 67918206,
        //    compiler: 'C++ (5.1.1)',
        //    time: 0,
        //    memory: 15224,
        //    source: '\n#include <iostream>\nusing namespace std;\nint main () {\n\tcout<<"Hello World";\n\treturn 0;\n}\n',
        //    input: null,
        //    error: null,
        //    cmpinfo: null,
        //    output: 'Hello World'
        // }

    })

})

module.exports = Sphere;

Scripts

  • npm run compile - Compiles source files to disk (~/lib).
  • npm run compile:watch - Same as npm run compile but watches files for changes.
  • npm run lint - Lints source and test files.
  • npm run lint:fix - Lints files and attempts to fix any issues.
  • npm run test - Runs unit tests.
  • npm run test:watch - Same as npm test but watches files for changes.
  • npm run test:cov - Generates a test coverage report.

Distribution

Execute one of the following commands

npm version patch
npm version minor
npm version major

License

MIT

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago