2.3.9 • Published 8 years ago

hackerearth-node v2.3.9

Weekly downloads
8
License
MIT
Repository
github
Last release
8 years ago

HackerEarth-node

NPM

awesomeBuild Status

Node JS library for using HackerEarth API

This library helps you to compile your code with HackerEarth API v3

Using HackerEarth API you can compile and run your code using their codeTable

npm install hackerearth-node

var hackerEarth=require('hackerearth-node'); //require the Library
//Now set your application 
var hackerEarth=new hackerEarth(
                                '**********',  //Your Client Secret Key here this is mandatory
                                ''  //mode sync=1 or async(optional)=0 or null async is by default and preferred for nodeJS
);
var config={};
config.time_limit=1;  //your time limit in integer
config.memory_limit=323244;  //your memory limit in integer
config.source='';  //your source code for which you want to use hackerEarth api
config.input="";  //input against which you have to test your source code
config.language="C/C++/Py/C#"; //optional choose any one of them or none
  ``` javascript
  //compile your code 
  hackerEarth.compile(config,function(err,response){
        if(err) {
          //deal with error
        } else {
          //deal with response
        }
  });

  ```
  • Using Promises

    //compile your code 
    hackerEarth.compile(config)
                            .then(result => {
                              //Handle Result
                            })
                            .catch(err => {
                              //Handle Error
                            });
  ``` javascript
  //compile your code 
  hackerEarth.run(config,function(err,response){
        if(err) {
          //deal with error
        } else {
          //deal with response
        }
  });

  ```
  • Using Promises

    //compile your code 
    hackerEarth.run(config)
                        .then(result => {
                          //Handle Result
                        })
                        .catch(err => {
                          //Handle Error
                        });
  • Use ES6 in source and transpile to babel for older version and put it into distribution/
  • Promisify whole package
  • Using travis build tools for testing
2.3.9

8 years ago

2.3.8

8 years ago

2.3.5

8 years ago

2.3.4

8 years ago

2.3.2

8 years ago

2.3.1

8 years ago

2.3.0

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.2

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago

0.0.1

9 years ago