Skip to content

Javascript starter project for Hash Code challenge

License

Notifications You must be signed in to change notification settings

gdgtorino/hash-code-js-starter-project

Repository files navigation

Hash Code Javascript Starter Project

GDG Torino

This is a basic JavaScript starter project for Google's HashCode competition.

Structure

index.js uses Commander.js to parse command line input.

The data-processing.js module contains some example functions to parse and process input data that take advantage of handy ES6 features such as destructuring declarations and new collection methods.

Prerequisites

Be sure to have a relatively recent version of nodejs and npm set up.

Install

Install the necessary dependencies with:

$ npm install

Run

To start the project cd in the root folder and run:

$ node index.js <inputFile> <outputFile>

To test the example run:

$ node index.js data/exampleInput.txt <outputFile>

or

$ npm run test

Command line alias

To create a command line alias for launching your program with a single keyword add a bin property in package.json pointing to index.js:

{
  ...
  "bin": {
    "hashcode": "./index.js"
  },
  ...
}

then run:

$ npm run link

Now you can launch you program with the hashcode alias:

$ hashcode <inputFile> <outpuFile>

Happy coding! 💻

GDG Torino

Releases

No releases published

Packages

No packages published