This console application is built with Node and Typescript. It can also be bundled to a single executable JS file using Webpack. The application should operate as follows:
- On startup, the program will prompt user for the number of seconds (X) between outputting the frequeuncy of each number to the screen.
- Every X seconds the program will display, in frequency descending order, the list of numbers and their frequency.
- If the user enters 'halt' the timer should pause.
- If the user enters 'resume' the timer should resume.
- If the user enters a number that is one of the first 1000 Fibonacci numbers, the system shoud alert 'FIB'. Entering the 1001th Fibonacci numbers will not have the same alert.
- If the user enters 'quit', the application should output the numbers and their frequency, a farewell message and finally terminate.
- Navigate to a desired directory, run
git clone
and use either https or ssh to clone the repo. cd timer-console-code-challenge
to navigate into the cloned repo.- Minimum requirement is to have Node version 12.16.0 or above. If
nvm
is used to manage Node versions, runnvm use
and it will use the Node version specified in.nvmrc
file. To install the specific node version, runnvm install 12.16.0
. - Run
npm install
to install packages. - Run
npm start
to start the interactive console program. Follow the instructions or enter 'quit' at anytime to terminate the program. - Alternatively, run
npm run build
to bundle all source files to a single executable JS file. To start the program, use the commandnode ./dist/bundle.js
. The program should operate as normal with additional performance boost. - The single JS file will also be useful for situation such as deployment and hosting through a CDN. This file can be assessed at directory
/dist/bundle.js
after running the build commandnpm run build
. - Run
npm test
to run all test suites. - Solutions for part 2 of the coding test can be found in
part2.text
.