Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamrulislam/log-parser
https://github.com/kamrulislam/log-parser
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kamrulislam/log-parser
- Owner: kamrulislam
- Created: 2019-11-22T09:54:27.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T01:36:18.000Z (almost 2 years ago)
- Last Synced: 2024-04-29T21:22:42.328Z (8 months ago)
- Language: TypeScript
- Size: 601 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
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`