{"id":51590571,"url":"https://github.com/bentimor/compact-console-log","last_synced_at":"2026-07-11T14:02:44.827Z","repository":{"id":253101599,"uuid":"842425505","full_name":"BenTimor/Compact-Console-Log","owner":"BenTimor","description":"An easy and intuitive way to use console.log in JavaScript and TypeScript projects","archived":false,"fork":false,"pushed_at":"2024-08-19T08:37:01.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-19T14:11:12.580Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/BenTimor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-08-14T10:23:59.000Z","updated_at":"2024-08-19T08:37:05.000Z","dependencies_parsed_at":"2024-08-14T13:50:32.265Z","dependency_job_id":null,"html_url":"https://github.com/BenTimor/Compact-Console-Log","commit_stats":null,"previous_names":["bentimor/compact-console-log"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BenTimor/Compact-Console-Log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FCompact-Console-Log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FCompact-Console-Log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FCompact-Console-Log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FCompact-Console-Log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenTimor","download_url":"https://codeload.github.com/BenTimor/Compact-Console-Log/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FCompact-Console-Log/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35364269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-07-11T14:02:43.922Z","updated_at":"2026-07-11T14:02:44.815Z","avatar_url":"https://github.com/BenTimor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Compact Console Log (CCL)\n\nCCL (Compact Console Log) is a Visual Studio Code extension designed to simplify debugging in JavaScript and TypeScript by streamlining console logging.\n\n## Quick Overview\n\n1. Highlight the code you want to log.\n2. Press `Ctrl + Alt + L` to log your selected code to the console.\n3. Execute your code and observe the output in the console.\n4. To remove the log, just press `Ctrl + Alt + L` on the logged statement. You can also remove all logs at once by pressing `Ctrl + Alt + K`.\n\n![DemoVSCode](https://i.imgur.com/iLPfCOs.gif \"DemoVSCode\")\n\n![DemoConsole](https://i.imgur.com/m417L5k.gif \"DemoConsole\")\n\n## Installation\n\nYou can easily install this extension from the [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=ibentimor.compact-console-log).\n\n## Usage Example\n\nHere’s a simple example to illustrate how CCL works:\n\n```javascript\nfunction add(a, b) {\n    return a - b;\n}\n\nconst numbers1 = [[1, 2], [3, 4], [5, 6]];\n\nconsole.log(numbers1.map(([a, b]) =\u003e add(a, b)).reduce((a, b) =\u003e a + b));\n\nconst numbers2 = [[7, 8], [9, 10], [11, 12]];\n\nconsole.log(numbers2.map(([a, b]) =\u003e add(a, b)).reduce((a, b) =\u003e a + b));\n```\n\nOops! We seem to have a bug. We expect the outputs to be `21` and `57`, but instead, we’re getting `-3` for both. It appears that our `add` function is malfunctioning, and we need to investigate.\n\nWithout CCL, we would have to manually insert `console.log` statements in each mapping function to track the return value of `add`.\n\n```javascript\nfunction add(a, b) {\n    return a - b;\n}\n\nconst numbers1 = [[1, 2], [3, 4], [5, 6]];\n\nconsole.log(numbers1.map(([a, b]) =\u003e {\n    const result = add(a, b);\n    console.log(\"1\", result);\n    return result;\n}).reduce((a, b) =\u003e a + b));\n\nconst numbers2 = [[7, 8], [9, 10], [11, 12]];\n\nconsole.log(numbers2.map(([a, b]) =\u003e {\n    const result = add(a, b);\n    console.log(\"2\", result);\n    return result;\n}).reduce((a, b) =\u003e a + b));\n```\n\nUpon checking the console output, we can see that our `add` function consistently returns `-1`. This leads us to discover that we mistakenly used the `-` operator instead of `+`.\n\nHowever, consider how much additional code we wrote just to debug this! Plus, we’ll need to remember to clean up those `console.log` statements afterward—what a hassle!\n\nWith CCL, we can simply select the `add` function and press `Ctrl + Alt + L` to log its return value easily. This is what it looks like:\n\n```javascript\nfunction add(a, b) {\n    return a - b;\n}\n\nconst numbers1 = [[1, 2], [3, 4], [5, 6]];\n\nconsole.log(numbers1.map(([a, b]) =\u003e 📢 add(a, b)).reduce((a, b) =\u003e a + b));\n\nconst numbers2 = [[7, 8], [9, 10], [11, 12]];\n\nconsole.log(numbers2.map(([a, b]) =\u003e 📢 add(a, b)).reduce((a, b) =\u003e a + b));\n```\n\nAfter running the code again and checking the console, we observe the `add` function still returns `-1`. Once we finish debugging, it’s a breeze to remove the log—we just place the cursor over the logged value and hit `Ctrl + Alt + L` again.\n\n### P.S. \nTo differentiate between various logs, the `📢` emoji along with the line number is appended to the colorful log, ensuring you won’t get confused during debugging.\n\n## Features\n\n### Log Selected Code\n\nSelect the code you want to log and press `Ctrl + Alt + L` to log it to the console.\nIf you want to select one word, you can put the cursor on the word and press `Ctrl + Alt + L`.\n\n### Remove Log\n\nTo remove a log, place the cursor over the logged value and press `Ctrl + Alt + L`.\n\n### Remove All Logs\n\nTo remove all logs at once, press `Ctrl + Alt + K`.\n\n### Asynchronous Functions Support\n\nCCL supports logging asynchronous functions and promises. You can log the return value of asynchronous functions and promises by selecting the function or promise and pressing `Ctrl + Alt + L`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentimor%2Fcompact-console-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbentimor%2Fcompact-console-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentimor%2Fcompact-console-log/lists"}