Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kamrulislam/log-parser


https://github.com/kamrulislam/log-parser

Last synced: 18 days ago
JSON representation

Awesome Lists containing this project

README

        

# Typescript based log parser - Node Console Application

This is a sample node console application that reads log from file and shows different required analysis.

## Setup

Clone this repo and move into the folder. Run the following commands.

Before running this project you need to have `node` installed. I have used node version `10.13`. If you are using `nvm`, run `nmv use` inside the folder.

```
# nvm use
npm i
npm run build
npm start
```

## Test

[jest](https://jestjs.io/en/) has been added as testing platform. Test file should be ended with `.spec.ts`. To run test, please use the following command

```
npm test
```

## Input

The application expects log file as `/input/log.log`

## Additional

- This project also includes some vscode extensions suggestions.
- Fully enforced `tslint`
- Latest testing framework (`jest`) has been used with
- iterable test
- deep object equality test

## Assumptions

- URL is considered same regardless of Method (eg., GET, POST) or Protocol (eg., HTTP/1.1)
- URL is considered different if there is a trailing `/` (eg., `/a` and `/a/` are different urls)

## High level architecture

- Input is read from `/input/log.log` file via `./src/input-reader`
- Input string is converted to `Log` via `./src/input-processor`
- All processing operations are in `./src/log-processor`
- All folder have exposed public API through `./src//index.ts`
- Program starts from `./src/index.ts`