Skip to content

TheRandomCrew/code-challenge-1242

Repository files navigation

Code Challenge #1242

The current project consist in a program that process a file with people's names and generate an output file with statistics.

Technologies

Features

How to install

Step Action Command
1 Download the project ----
2 Install dependencies npm i
3 Ran the project for development npm run dev
4 Build the project npm run build

That's all!.

The last command will run the project with the input.txt file, but you can also run the project with a custom input file or request a custom number of names in the modified list generated:

Run the project

There are several ways to ran the project depending of what you want to do:

For development purposes:

Method Action Command
1 Run the project with the default input file npm run dev
2 Run the project with a custom input file ts-node src/index.ts [custom_input_path]
3 Change the limit of names generated at the end of the program ts-node src/index.ts input.txt [N-of-names]
4 Ran the project with a custom input file and a custom N ts-node src/index.ts [custom_input_path] [N-of-names]

Ran the compiled program

Follow these steps to compile the program.

Once you have the program compiled, then you could run the output file using node or ts-node, please check this examples:

  1. I'm in the project root folder and will compile the program: npm run build
  2. A file is generated in the path bin/index.js
  3. I will to run that file: node bin/index.js input.txt 40

File structure

file-structure src: In source folder are all the logic of the program, here's where you can change or add new functionalities. In the src/index.ts you'll find the main logic of the APP
features: In this folder you'll find the business logic of the program.
  • files: Here's the logic to handle files: Read files, lines or write a new file.
  • names: In this folder you'll find the logic to handle the names and create the statistics.
interface: Here's the logic related to the different interfaces of the program, currently we've just a CLI interface, which is creating two new interfaces which are the output (how the output looks) and the errors (how the errors are shown to the user).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors