{"id":16560639,"url":"https://github.com/mathieu2301/console","last_synced_at":"2025-03-05T03:23:26.880Z","repository":{"id":92266423,"uuid":"356607354","full_name":"Mathieu2301/Console","owner":"Mathieu2301","description":"Easy console colors","archived":false,"fork":false,"pushed_at":"2021-04-12T23:13:33.000Z","size":363,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-16T08:46:07.680Z","etag":null,"topics":["colors","console","console-log","formatting","log","logging","logging-and-metrics","timestamp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mathieu2301.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-04-10T14:33:37.000Z","updated_at":"2021-04-24T02:44:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5f80ed3-ef12-4620-a061-b262938973cb","html_url":"https://github.com/Mathieu2301/Console","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"9f59e41f405677569ebdb1c0630644b8ea54eee1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathieu2301%2FConsole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathieu2301%2FConsole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathieu2301%2FConsole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathieu2301%2FConsole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mathieu2301","download_url":"https://codeload.github.com/Mathieu2301/Console/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241956513,"owners_count":20048644,"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":["colors","console","console-log","formatting","log","logging","logging-and-metrics","timestamp"],"created_at":"2024-10-11T20:29:39.347Z","updated_at":"2025-03-05T03:23:26.849Z","avatar_url":"https://github.com/Mathieu2301.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Console\n  Better console :\n  - Easy colors\n  - Auto timestamp\n\n![Alt text](/img/test.jpg \"Test 1\")\n\n## Installation\n  ```\n  npm i @mathieuc/console\n  ```\n\n  Then:\n\n  ```javascript\n  require('@mathieuc/console')( // Just import the lib\n    '§',  // Character you want to use (defaut: '§')\n    true, // Active timestamp (defaut: false)\n    CORR, // Custom timestamp correction in milliseconds (defaut: 0)\n    '94', // Custom timestamp color (defaut: '94' =\u003e Light blue)\n  );\n\n  // Then you can use\n\n  console.log(...);\n  console.info(...);\n  console.warn(...);\n  console.error(...);\n\n  // Bonus: To calculate the necessary CORR, you can use 'Date().getTimezoneOffset()'\n  // CORR = parseInt(new Date().getTimezoneOffset() * 60 + 7200, 10) * 1000\n  ```\n\n## Console colors\n  This lib allows you to use any character as an alias to `\\x1b[Xm`.\n\n### Example\n  If you use '§' as alias,\n  ```javascript\n  console.log('\\x1b[31mRed \\x1b[32mGreen \\x1b[33mYellow');\n  ```\n  becomes\n  ```javascript\n  console.log('§31Red $32Green §33Yellow');\n  ```\n\nThere are two parameters (digits) :\n  - First is type: it can be 3, 4, 9, 10 or nothing\n  - Second is color, between 0 and 7\n\n### Types :\n- **`X`**: Formatting\n    - **`0`**: Reset\n    - **`1`**: **Bold**\n    - **`3`**: *Italic*\n    - **`7`**: Reverse\n    - **`8`**: Hidden\n- **`3X`**: Colors\n- **`4X`**: Background\n- **`9X`** : Colors (light)\n- **`10X`**: Background (light)\n\n### Colors : (*3X, 4X, 9X, 10X*)\n- **`0`**: ![Black](https://via.placeholder.com/10/000/?text=+) Black\n- **`1`**: ![color](https://via.placeholder.com/10/f00/?text=+) Red\n- **`2`**: ![color](https://via.placeholder.com/10/0f0/?text=+) Green\n- **`3`**: ![color](https://via.placeholder.com/10/ff0/?text=+) Yellow\n- **`4`**: ![color](https://via.placeholder.com/10/00f/?text=+) Blue\n- **`5`**: ![color](https://via.placeholder.com/10/f0f/?text=+) Magenta\n- **`6`**: ![color](https://via.placeholder.com/10/0ff/?text=+) Cyan\n- **`7`**: ![color](https://via.placeholder.com/10/fff/?text=+) White\n\n### Combinations\n  If you use `§` as alias, you can combine formatting with font color and background color.\n  - `§3§44§30` =\u003e Italic (`§3`) + Black font (`§30`) + Blue background (`§44`)\n  - `§3§104§30` =\u003e Italic (`§3`) + Black font (`§30`) + Light blue background (`§104`)\n\n  ![Alt text](/img/test2.jpg \"Test 1\")\n\n## Problems\n If you have errors in console or unwanted behavior, just reload the page.\n If the problem persists, please create an issue [here](https://github.com/Mathieu2301/Console/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieu2301%2Fconsole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathieu2301%2Fconsole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieu2301%2Fconsole/lists"}