Author: Umberto Pepato
This is a basic JavaScript starter project for Google's HashCode competition.
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.
Be sure to have a relatively recent version of nodejs and npm set up.
Install the necessary dependencies with:
$ npm install
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
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! 💻