{"id":24806152,"url":"https://github.com/omunite215/project_colorful_logs","last_synced_at":"2026-04-06T08:01:54.262Z","repository":{"id":274789481,"uuid":"923958535","full_name":"omunite215/Project_Colorful_Logs","owner":"omunite215","description":"It lets you write colorful log messages for your terminal without needing any External Library like Chalk, Colors, etc.","archived":false,"fork":false,"pushed_at":"2025-03-05T05:36:21.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T09:12:30.731Z","etag":null,"topics":["bun","colors","console","console-color","consolelog","consolelog-color","javascript","log","nodejs","typescript"],"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/omunite215.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":"2025-01-29T06:24:16.000Z","updated_at":"2025-02-06T03:56:50.000Z","dependencies_parsed_at":"2025-01-29T12:39:50.958Z","dependency_job_id":null,"html_url":"https://github.com/omunite215/Project_Colorful_Logs","commit_stats":null,"previous_names":["omunite215/project_colorful_logs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omunite215%2FProject_Colorful_Logs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omunite215%2FProject_Colorful_Logs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omunite215%2FProject_Colorful_Logs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omunite215%2FProject_Colorful_Logs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omunite215","download_url":"https://codeload.github.com/omunite215/Project_Colorful_Logs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245431731,"owners_count":20614184,"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":["bun","colors","console","console-color","consolelog","consolelog-color","javascript","log","nodejs","typescript"],"created_at":"2025-01-30T08:19:17.231Z","updated_at":"2025-12-30T23:25:43.117Z","avatar_url":"https://github.com/omunite215.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project_Colorful_Logs\n\n![image](https://github.com/user-attachments/assets/00f90012-be67-4d73-b172-46f55c37f226)\n\nMeaningful Customized Colorful Log Messages for your terminal without needing any External Library\n\nMotivation: When I saw other libraries like colors were just used for making some lines colorful in terminal.\nI came up with this solution where you do not need to install any third party library and easily define beautiful \nlog just by putting this function wherever you want.\n\n### How to use this repository\nJust copy and paste this code in your typescript project\n```bash\ntype LogType = \"error\" | \"info\" | \"log\" | \"success\" | \"warning\";\n\ntype CustomLogType = (type: LogType, message: string) =\u003e void;\n\n// Check if ANSI escape codes are supported\nconst isWindowsCmd = process.platform === \"win32\" \u0026\u0026 !process.env.TERM;\n\nexport const customLog: CustomLogType = (type, message) =\u003e {\n  // ANSI color codes (only if supported)\n  const styles: Record\u003cLogType, string\u003e = isWindowsCmd\n    ? { error: \"\", log: \"\", success: \"\", warning: \"\", info: \"\" } // No colors in Windows CMD\n    : {\n        error: \"\\x1b[1m\\x1b[37m\\x1b[41m\", // Bold White text on Red background\n        log: \"\\x1b[1m\\x1b[37m\\x1b[47m\", // Bold White text on White background\n        success: \"\\x1b[1m\\x1b[37m\\x1b[42m\", // Bold White text on Green background\n        warning: \"\\x1b[1m\\x1b[30m\\x1b[43m\", // Bold Black text on Yellow background\n        info: \"\\x1b[1m\\x1b[37m\\x1b[46m\" // Bold Text with Aqua Blue background\n      };\n\n  const reset = isWindowsCmd ? \"\" : \"\\x1b[0m\"; // Reset styles (only if supported)\n\n  const formattedMessage = `${styles[type]}${message}${reset}`;\n\n  switch (type) {\n    case \"error\":\n      console.error(formattedMessage);\n      break;\n    case \"info\":\n      console.info(formattedMessage);\n      break;\n    case \"warning\":\n      console.warn(formattedMessage);\n      break;\n    default:\n      console.log(formattedMessage);\n  }\n};\n\n```\n\n### Here's a Demo\n```bash\nimport { customLog } from \"path_to_file\";\ncustomLog(\"error\", \"This is a Sample Error Message\");\ncustomLog(\"info\", \"This is a Sample Info Message\");\ncustomLog(\"log\", \"This is a Sample Log Message\");\ncustomLog(\"success\", \"This is a Sample Success Message\");\ncustomLog(\"warning\", \"This is a Sample Warning Message\");\n```\n\n### Compatibility:\n[![My Skills](https://skillicons.dev/icons?i=js,ts)](https://skillicons.dev)\n\n- ✅ Mac (Terminal, iTerm, VS Code Terminal, etc.) → Works fine.\n- ✅ Windows (PowerShell, Windows Terminal, VS Code Terminal) → Works fine.\n- ⚠️ Windows (Command Prompt) → ANSI codes may not work correctly. Use PowerShell or install chalk for compatibility.\n\n### Want a JavaScript Version ?\n#### [customLog.js](src/customLogs/customLogs.js)\n\n## :star: Give A Star\n\nYou can also give this repository a star to show more people and they can use this repository.\n\n## 🏠 Built With:\n\n[![My Skills](https://skillicons.dev/icons?i=ts,bun,vscode,arch,linux)](https://skillicons.dev)\n\n## 🛠 Skills\n\n[![My Skills](https://skillicons.dev/icons?i=git,github)](https://skillicons.dev)\n\n\n## 🙋‍♂️ Connect With Me\n\n[\u003cimg src=\"https://skillicons.dev/icons?i=github\" /\u003e](https://github.com/omunite215)\u0026nbsp;\n[\u003cimg src=\"https://skillicons.dev/icons?i=linkedin\" /\u003e](https://www.linkedin.com/in/om-patel-401068143/)\u0026nbsp;\n[\u003cimg src=\"https://skillicons.dev/icons?i=instagram\" /\u003e](https://www.instagram.com/_21omp/)\u0026nbsp;\n[\u003cimg src=\"https://skillicons.dev/icons?i=devto\" /\u003e](https://portfolio-jade-gamma-13.vercel.app/)\n\n\n## 🗒️ Authors\n- Om Patel\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://skillicons.dev\"\u003e\n    \u003ca href=\"https://github.com/omunite215\"\u003e\n      \u003cimg src=\"https://skillicons.dev/icons?i=github\" /\u003e\n    \u003c/a\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/c1599499-a256-4900-a3d8-25d20dc7f5ae\" alt=\"Om's Logo Image\"/\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomunite215%2Fproject_colorful_logs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomunite215%2Fproject_colorful_logs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomunite215%2Fproject_colorful_logs/lists"}