{"_id":"@5ed5war5it/js-table","name":"@5ed5war5it/js-table","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@5ed5war5it/js-table","version":"1.0.0","description":"Library for generating tables based on dataset, stylization is supported.","main":"index.js","scripts":{"test":"node index"},"keywords":["js","javascript","render","table","cli"],"author":{"name":"E5war5IT"},"license":"MIT","_id":"@5ed5war5it/js-table@1.0.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-9XoNohMeNH/dK56y3Knn4Nbmm/dERRXdLJ0OYefEbeGL+abpLdtIykpLBoACCp82p7gs2S/kZ4fE1LuPtfNGjg==","shasum":"587281e3a777ce5bed17f213830caf506f6c98e1","tarball":"https://registry.npmjs.org/@5ed5war5it/js-table/-/js-table-1.0.0.tgz","fileCount":4,"unpackedSize":15893,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhkc54ojwBO8G1lYekCHDeBa6JBBdU4xWxnHEOLLcVIAIhAM76hs4v7Z5Ca/R3u+hzCaMe2GdmRNOTZckAjGlBmkQu"}]},"_npmUser":{"name":"5ed5war5it","email":"eduard.17072006@gmail.com"},"directories":{},"maintainers":[{"name":"5ed5war5it","email":"eduard.17072006@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-table_1.0.0_1704735552374_0.45684205561247127"},"_hasShrinkwrap":false}},"time":{"created":"2024-01-08T17:39:12.270Z","1.0.0":"2024-01-08T17:39:12.550Z","modified":"2024-01-08T17:39:12.857Z"},"maintainers":[{"name":"5ed5war5it","email":"eduard.17072006@gmail.com"}],"description":"Library for generating tables based on dataset, stylization is supported.","keywords":["js","javascript","render","table","cli"],"author":{"name":"E5war5IT"},"license":"MIT","readme":"# js-table: A JavaScript Library for Rendering Tables in the Console\n\n## Introduction\n\njs-table is a JavaScript library that allows you to easily render tables in the console. It provides a simple and intuitive API for creating tables with various styles and formatting options.\n\n## Installation\n\nTo install `js-table`, simply run the following command in your terminal:\n\n```bash\nnpm install js-table\n```\n\n## Usage\n\nTo use js-table, import the library into your JavaScript file:\n\n```javascript\nimport TableCLI from 'js-table';\n```\n\nOnce imported, you can use the `redner` method to render a table. The `redner` method takes two parameters:\n\n* `table`: The table object containing rows and dataset.\n* `params`: The parameters object containing styles, fill, and gap.\n\nThe following code snippet shows how to use the `redner` method to render a simple table:\n\n```javascript\nconst table = {\n  rows: ['Name', 'Age', 'City'],\n  dataset: [\n    ['John Doe', 30, 'New York'],\n    ['Jane Doe', 25, 'Los Angeles'],\n    ['Peter Smith', 40, 'Chicago'],\n  ],\n};\n\nconst params = {\n  styles: {\n    color: {\n      row: ['\\x1b[32m', '\\x1b[38;0;0m'],\n      header: ['\\x1b[36m', '\\x1b[38;0;0m'],\n    },\n  },\n  fill: '-',\n  gap: 2,\n};\n\nconst renderedTable = TableCLI.redner(table, params);\n\nconsole.log(renderedTable);\n```\n\nThe above code will render the following table in the console:\n\n```\nName         Age  City\n-----------  ---  -----------\nJohn Doe     30   New York\nJane Doe     25   Los Angeles\nPeter Smith  40   Chicago\n```\n\n## API\n\nThe `js-table` library provides the following methods:\n\n* `redner(table, params)`: Renders a table with the given data and parameters.","readmeFilename":"readme.md"}