Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 1.7 KB

readme.md

File metadata and controls

55 lines (38 loc) · 1.7 KB

hackerrank.js

A JavaScript framework for running HackerRank challenges on your local machine.

Requirements:

  • Node v6+

Installation:

# Clone/fork the repository
git clone --depth 1 https://github.com/itho/hackerrank.js.git

# Change directory
cd hackerrank

# Install dependencies
npm install

Usage:

  1. On all HackerRank challenges, you can see a link on the right side bar "Download sample test cases". Clicking this will start the download of the available input & output files.
  2. Create a folder for the challenge like /challenges/solve-me-first/. Move the downloaded input and output folders here along with your solution named solution.js. Copy in the stub from HackerRank and get hacking!
  3. Run the commands below from the root of the project.
# If your codes outputs to the console/stdout
node hackerrank.js challenges/solve-me-first --console
node hackerrank.js challenges/solve-me-first --stdout

# If your code outputs to a file
node hackerrank.js challenges/solve-me-first --file
  1. You can also add additional/custom testcases. Just ensure that the input and output filenames match.

Examples:

License

itho/hackerrank is MIT licensed.