{"id":21616959,"url":"https://github.com/kgrz/babel-plugin-transform-console-log-variable-names","last_synced_at":"2025-04-11T07:36:59.943Z","repository":{"id":57188928,"uuid":"106189671","full_name":"kgrz/babel-plugin-transform-console-log-variable-names","owner":"kgrz","description":null,"archived":false,"fork":false,"pushed_at":"2017-10-12T04:38:50.000Z","size":45,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T14:40:45.844Z","etag":null,"topics":["babel-plugin","javascript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/kgrz.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}},"created_at":"2017-10-08T16:03:25.000Z","updated_at":"2019-07-31T21:01:29.000Z","dependencies_parsed_at":"2022-08-28T11:11:23.223Z","dependency_job_id":null,"html_url":"https://github.com/kgrz/babel-plugin-transform-console-log-variable-names","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgrz%2Fbabel-plugin-transform-console-log-variable-names","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgrz%2Fbabel-plugin-transform-console-log-variable-names/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgrz%2Fbabel-plugin-transform-console-log-variable-names/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgrz%2Fbabel-plugin-transform-console-log-variable-names/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kgrz","download_url":"https://codeload.github.com/kgrz/babel-plugin-transform-console-log-variable-names/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248359046,"owners_count":21090468,"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":["babel-plugin","javascript"],"created_at":"2024-11-24T22:16:00.198Z","updated_at":"2025-04-11T07:36:59.898Z","avatar_url":"https://github.com/kgrz.png","language":"JavaScript","readme":"babel-plugin-transform-console-log-variable-names\n-------------------------------------------------\n\n__WARNING: Very very alpha code quality__\n\nEverytime I try to `console.log` a variable's value, I forget to label\nthe variable and so the logged statements become unuseful and confusing,\nespecially when used inside a loop—case in point: React's `render`\nfunction, or `componentWillReceiveProps`.\n\n\nThis plugin transforms `console.log` statements that have just variable\nlabels as arguments and prepends a string that specifies what those\nlabels are. For example, for the following statements:\n\n```javascript\n\nconst a = 12;\nconst b = 13;\nconst c = 59;\n\nconsole.log(a);\nconsole.log(a, b);\nconsole.log(a, b, c);\n```\n\nThe output would look something like:\n\n\n```\na: 12\na, b: 12 13\na, b, c: 12, 13, 59\n```\n\nCheckout another plugin around `console.log` usage I wrote: https://github.com/kgrz/babel-plugin-console-groupify\n\nUsage\n-----\n\nInstall the module with:\n\n```\nnpm i -D babel-plugin-transform-console-log-variable-names\n```\n\nInclude it in your babel configuration either via `.babelrc` or webpack.\nHere's a `.babelrc` example:\n\n```json\n{\n\t\"presets\": [...],\n\t\"plugins\": [\n\t\t\"transform-console-log-variable-names\"\n\t]\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgrz%2Fbabel-plugin-transform-console-log-variable-names","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkgrz%2Fbabel-plugin-transform-console-log-variable-names","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgrz%2Fbabel-plugin-transform-console-log-variable-names/lists"}