{"id":22887587,"url":"https://github.com/imjching/node-hackerearth","last_synced_at":"2025-04-14T23:14:06.838Z","repository":{"id":77658632,"uuid":"49656808","full_name":"imjching/node-hackerearth","owner":"imjching","description":"A node.js wrapper for the HackerEarth API.","archived":false,"fork":false,"pushed_at":"2016-01-16T10:18:40.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T23:13:56.708Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imjching.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-14T15:43:13.000Z","updated_at":"2018-08-21T20:28:26.000Z","dependencies_parsed_at":"2023-05-24T18:00:40.143Z","dependency_job_id":null,"html_url":"https://github.com/imjching/node-hackerearth","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"62354fd8af0fa82b4dcecce96bf4c09ba24826e4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjching%2Fnode-hackerearth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjching%2Fnode-hackerearth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjching%2Fnode-hackerearth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjching%2Fnode-hackerearth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imjching","download_url":"https://codeload.github.com/imjching/node-hackerearth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975329,"owners_count":21192210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T20:36:38.871Z","updated_at":"2025-04-14T23:14:06.806Z","avatar_url":"https://github.com/imjching.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-hackerearth\n\n[![npm status](http://img.shields.io/npm/v/node-hackerearth.svg?style=flat-square)](https://www.npmjs.org/package/node-hackerearth) [![Travis build status](https://travis-ci.org/imjching/node-hackerearth.svg?branch=master\u0026style=flat-square\u0026label=travis)](https://travis-ci.org/imjching/node-hackerearth)\n\nA node.js wrapper for the HackerEarth API.\n\nCurrently, both version 2 and 3 of the HackerEarth API are supported through *node-hackerearth*. However, version 2 has been discontinued by HackerEarth.\n\nFurther information on the HackerEarth API and its features are available at [https://www.hackerearth.com/docs/api/developers/code/v3/](https://www.hackerearth.com/docs/api/developers/code/v3/).\n\n## Table of Contents\n\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n\n## Installation\n\nInstalling using npm (node package manager):\n\n    npm install node-hackerearth\n\nIf you don't have npm installed or don't want to use it:\n\n    cd ~/.node_libraries\n    git clone git@github.com:imjching/node-hackerearth.git\n\nPlease note that parts of *node-hackerearth* depend on [request](http://github.com/mikeal/request) by [Mikeal Rogers](http://github.com/mikeal). This library needs to be installed for the API to work. If you are using npm, all dependencies should be automatically resolved for you.\n\n## Usage\n\n**Attention**: Support for v2 of the HackerEarth API is not yet well tested as the API endpoints have been discontinued by HackerEarth.\n\n*HackerEarthAPI* takes two arguments. The first argument is your client secret key, which you can register one [here](https://www.hackerearth.com/api/register/). The second argument is an options object which can contain the following options:\n\n * `version` The API version to use (2 or 3). Defaults to 3.\n\nThe HackerEarth API provides two main functions: *compile* and *run*. These are available in this wrapper. You can use the methods `compile` and `run` and each of them takes two parameters:\n\n * `params` Parameters to pass to the API method\n * `callback` Callback function for returned data or errors with two parameters. The first one being an error object which is null when no error occured, the second one an object with all information retrieved as long as no error occured.\n\nExample:\n\n```javascript\nvar HackerEarthAPI = require('node-hackerearth');\n\nvar clientSecretKey = 'Your client secret key';\n\nvar api = new HackerEarthAPI(clientSecretKey);\n\nvar data = \"print 'Hello World'\";\n\napi.compile({ source: data, lang: 'PYTHON' }, function (err, data) {\n  if (err) {\n    console.log(err.message);\n  } else {\n    console.log(JSON.stringify(data)); // Do something with your data\n  }\n});\n\napi.run({ source: data, lang: 'PYTHON', time_limit: 1 }, function (err, data) {\n  if (err) {\n    console.log(err.message);\n  } else {\n    console.log(JSON.stringify(data)); // Do something with your data\n  }\n});\n```\n\n## TODO\n- Complete unit tests\n\n## License\n\n*node-hackerearth* is licensed under the MIT License. (See LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjching%2Fnode-hackerearth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimjching%2Fnode-hackerearth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjching%2Fnode-hackerearth/lists"}