2** EPITECH PROJECT, 2024
10 * @brief File to parse the arguments passed to the app
13// Import minimist for argument parsing
14const minimist = require('minimist');
16// Use minimist to parse the arguments
17const args = minimist(process.argv.slice(2));
19console.log(args); // Logs the parsed arguments to check if it works
21export namespace Args {
24 * Function to get the port from the arguments
25 * @returns {string|null} the port value or null if not provided
27 export function get_port(): number {
28 return args.port || null; // Access the port via the argument name, e.g., --port=3000
32 * Function to get the IP from the arguments
33 * @returns {string|null} the IP value or null if not provided
35 export function get_ip(): string {
36 return args.ip || null; // Access the IP via the argument name, e.g., --ip=192.168.1.1