Node application that Generates Random Phone Numbers.
- It Writes the numbers in 3 files :-
-
1 - phoneNumbers.json, for all generated numbers.
-
2 - phoneNumbers-asc.json, for all generated numbers in ascending order based on phone number value.
-
3 - phoneNumbers-desc.json, for all generated numbers in descending order based on phone number value.
-
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
What things you need to install the software and how to install them
npm or yarn
, npm comes along with the installation of node which can be installed using usingbrew install node
on a mac for other platforms follow this - Guide.
How to get it running on your local machine.
- Clone the Application using this command
git clone https://github.com/kisakyegordon/phone-generator
-
Enter the cloned directory.
-
Run
npm install
oryarn
, to install any dependant libraries.
- To start the application, run the
npm start
oryarn start
commands. - Starting the application also proceeds to generate a random number each time its run, the random number relates to the number of phone contacts created each time.
To locally run the tests
- run the
npm test
oryarn test
, you can also see the whole coverage by appending --coverage ienpm test --coverage
.
-
After setting everything up, when you start the application with
npm start
oryarn start
.These are the things that happen :-
1 - Total Number of randomly generated numbers is logged on the console.
2 - Smallest and Largest generated numbers are logged on the screen with their Id's.
3 - 3 files are generated in the applications
root-directory
ie-
phoneNumbers.json - Contains all generated phone numbers.
-
phoneNumbers-asc.json - Contains generated phone numbers arranged in Ascending order.
-
phoneNumbers-desc.json - Contains generated phone numbers arranged in Deccending order
-