{"id":24598425,"url":"https://github.com/alfonsovidrio/node-ts-multiplication-app","last_synced_at":"2026-04-12T20:40:19.962Z","repository":{"id":250981237,"uuid":"836018700","full_name":"AlfonsoVidrio/node-ts-multiplication-app","owner":"AlfonsoVidrio","description":"Este repositorio contiene una aplicación en Node.js desarrollada con TypeScript que genera tablas de multiplicar y las guarda en un archivo de texto. La aplicación utiliza la biblioteca yargs para gestionar parámetros de línea de comandos, lo que permite una personalización flexible en la generación de las tablas.","archived":false,"fork":false,"pushed_at":"2024-08-06T03:32:05.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T12:16:15.888Z","etag":null,"topics":["nodejs","typescript","yargs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlfonsoVidrio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-31T02:09:37.000Z","updated_at":"2025-01-03T06:22:02.000Z","dependencies_parsed_at":"2024-07-31T06:09:10.786Z","dependency_job_id":null,"html_url":"https://github.com/AlfonsoVidrio/node-ts-multiplication-app","commit_stats":null,"previous_names":["alfonsovidrio/node-ts-multiplication-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlfonsoVidrio%2Fnode-ts-multiplication-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlfonsoVidrio%2Fnode-ts-multiplication-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlfonsoVidrio%2Fnode-ts-multiplication-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlfonsoVidrio%2Fnode-ts-multiplication-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlfonsoVidrio","download_url":"https://codeload.github.com/AlfonsoVidrio/node-ts-multiplication-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244164123,"owners_count":20408860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","typescript","yargs"],"created_at":"2025-01-24T12:16:18.987Z","updated_at":"2026-04-12T20:40:19.950Z","avatar_url":"https://github.com/AlfonsoVidrio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multiplication Table Generator\n\n## Description\n\nThis Node.js application, developed with TypeScript and the `yargs` library, generates multiplication tables and saves them as text files. It provides a flexible way to configure the base and limit of the table, with options to display the table in the console and customize the file name and destination folder.\n\n## Features\n\n- **Multiplication Table Generation**: Creates multiplication tables for any numeric base.\n- **Configurable Limits**: Set the upper limit for multiplication. Default is 10.\n- **Console Display**: Option to print the multiplication table in the console.\n- **Text File Output**: Saves the generated table to a text file, with customizable file name and destination folder.\n- **Input Validation**: Ensures the base number is greater than zero.\n\n## Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/AlfonsoVidrio/note-ts-multiplication-app\n    ```\n\n2. Navigate to the project directory:\n    ```bash\n    cd note-ts-multiplication-app\n    ```\n\n3. Install dependencies:\n    ```bash\n    npm install\n    ```\n\n## Usage\n\n- To run the application, use one of the following commands with the required parameters:\n    ```bash\n    npx ts-node src/app.ts --b \u003cbase\u003e --l \u003climit\u003e --s --d \u003cdestination\u003e --n \u003cname\u003e\n\n    npm run dev -- --b \u003cbase\u003e --l \u003climit\u003e --s --d \u003cdestination\u003e --n \u003cname\u003e\n    ```\n## Parameters\n\n- **--base or -b**: Sets the base number for the multiplication table. This parameter is required.\n\n- **--limit or -l**: Sets the maximum multiplier. *Optional*, defaults to `10`.\n\n- **--show or -s**: Indicates whether the table should be displayed in the console. *Optional*, defaults to `false`.\n\n- **--name or -n**: Name of the output file where the table will be saved. *Optional*, defaults to `multiplication-table.txt`.\n\n- **--destination or -d**: Output folder where the file will be saved. *Optional*, defaults to `outputs`.\n\n## Example\n\nTo generate a multiplication table with base `10`, limit `4`, display it in the console, and save it in a file named `table.txt` inside the `outputs` folder, use the following command:\n\n   ```bash\n   ts-node src/app.ts -b 10 -l 4 -s -d outputs -n table.txt\n   ```\n\n#### In this example:\n\n- The table base is `10`.  \n- The multiplication limit is `4`.  \n- The table will be displayed in the console (`-s`).  \n- The file will be saved in the `outputs` folder with the name `tablas-multiplicar.txt`.\n\n## Packaging for CLI Use\n\nTo package and use this application as a global command-line tool, follow these steps:\n\nMake sure the `package.json` file has the `bin` field properly configured:\n\n```json\n\"bin\": {\n  \"multiplication-app\": \"dist/app.js\"\n}\n```\n\nThis tells npm that the `multiplication-app` command should run the `dist/app.js` file.\n\n### Compile the TypeScript code to JavaScript\n\nRun the following command to transpile the code to JavaScript:\n\n```bash\nnpm run build\n```\nLink the package globally:\n\nFirst, unlink any previous global installation of the package:\n\n```bash\nnpm unlink -g multiplication-app\n```\nThen, link the package locally for global use:\n\n```bash\nnpm link\n```\nThis will create a global symbolic link that allows you to run multiplication-app from anywhere in your terminal.\n\nRun the command globally:\n\nNow you can use the `multiplication-app` command anywhere on your system. For example:\n\n```bash\nmultiplication-app --b 8 --l 10 --s --n table.txt --d outputs\n```\n\nThis will generate a multiplication table with base `8`, limit `10`, display it in the console, and save the file in the specified or current location.\n\n```\nServer running...\n8 x 1 = 8\n8 x 2 = 16\n8 x 3 = 24\n8 x 4 = 32\n8 x 5 = 40\n8 x 6 = 48\n8 x 7 = 56\n8 x 8 = 64\n8 x 9 = 72\n8 x 10 = 80\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfonsovidrio%2Fnode-ts-multiplication-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falfonsovidrio%2Fnode-ts-multiplication-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfonsovidrio%2Fnode-ts-multiplication-app/lists"}