This TypeScript Node.js application reads algebraic expressions from an input file (CSV or TSV), evaluates them, and writes the results to an output file. The application is designed with flexibility in mind, allowing easy configuration and extension to support additional file formats.
- Node.js (v14 or higher recommended)
- npm (comes with Node.js)
-
Clone the repository:
git clone https://github.com/yourusername/algebraic-expression-evaluator.git cd algebraic-expression-evaluator
-
Install dependancies:
npm install
-
npm run build
-
npm start
- The configuration file (config.json) specifies the input and output file paths and the file type (CSV or TSV).
{
"files": [
{
"inputFilePath": "resources/input.csv",
"outputFilePath": "resources/output.csv",
"fileType": "csv"
},
{
"inputFilePath": "resources/input.tsv",
"outputFilePath": "resources/output.tsv",
"fileType": "tsv"
}
]
}
- To support new file formats, implement the FileReader and FileWriter interfaces, then register the new services in the FileHandlerRegistry.
FileHandlerRegistry.register(
'json',
new JsonReaderService(),
new JsonWriterService()
);