1.0.4 • Published 4 years ago

log-parser-code-test v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Log Parser Module

Log Parser Demo

Log Parser for HTTP Request log file

oclif Version Codecov Downloads/week License

Tech Stack

TechnologyDescriptionLink ↘️
JavaScriptHigh Level, Dynamic, Interpreted Language----
Node JSJavaScript Runtimehttps://nodejs.org/en/
oclifOpen CLI Frameworkhttps://oclif.io/

Usage

Local

Ensure Node.js and NPM or Yarn are installed

  1. Install required dependencies
npm install or npm i
  1. Run the application
./bin/run.cmd or ./bin/run 

Commands

log-parser analyse [FILE]

Analyse log file with HTTP Requests

USAGE
  $ log-parser analyse [FILE]

OPTIONS
  -f, --file
  -h, --help       show CLI help

See code: src\commands\analyse.ts

log-parser help [COMMAND]

display help for log-parser

USAGE
  $ log-parser help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

Testing

In order to test, run the following command:

npm run test

Testing Demo

Considerations-Thoughts

  • While choosing the top 3 active IP addresses or visited urls, there were some that were overlapping. For now, sort and only retrieved the top 3.
  • Decided to go with TypeScript for type safety and extensibility in the future if required
  • Arrow functions can be refactored if single parameter but oclif ESLint has it's own standards
  • Making use of regex named groups to make it easier to group data required
  • Could also use split instead of regex to potentially achieve the same result

Improvements to be made

  • Testing coverage could possibly be improved
  • Work on cleaning code up further and refactoring more
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago