{"id":16918575,"url":"https://github.com/martinkolarik/babel-plugin-dedent","last_synced_at":"2026-03-01T15:34:09.153Z","repository":{"id":31427832,"uuid":"34991358","full_name":"MartinKolarik/babel-plugin-dedent","owner":"MartinKolarik","description":"Remove indentation from multiline template strings","archived":false,"fork":false,"pushed_at":"2020-10-09T12:42:46.000Z","size":61,"stargazers_count":32,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T10:46:09.433Z","etag":null,"topics":["babel","indentation","javascript","nodejs"],"latest_commit_sha":null,"homepage":null,"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/MartinKolarik.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}},"created_at":"2015-05-03T15:52:40.000Z","updated_at":"2020-10-09T12:42:45.000Z","dependencies_parsed_at":"2022-09-07T21:01:04.775Z","dependency_job_id":null,"html_url":"https://github.com/MartinKolarik/babel-plugin-dedent","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinKolarik%2Fbabel-plugin-dedent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinKolarik%2Fbabel-plugin-dedent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinKolarik%2Fbabel-plugin-dedent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinKolarik%2Fbabel-plugin-dedent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MartinKolarik","download_url":"https://codeload.github.com/MartinKolarik/babel-plugin-dedent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244951090,"owners_count":20537318,"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","indentation","javascript","nodejs"],"created_at":"2024-10-13T19:40:42.116Z","updated_at":"2026-03-01T15:34:09.091Z","avatar_url":"https://github.com/MartinKolarik.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-dedent\n\nRemoves indentation from multiline template strings. Works with both tabs and spaces.\n\nNot using Babel? [Here's a runtime version of this plugin.](https://github.com/MartinKolarik/dedent-js)\n\n## Installation\n\n```\n$ npm install babel babel-plugin-dedent\n$ babel --plugins dedent script.js\n```\n\n### Babel v6+\n\nv2.x.x of this plugin is required. Older versions are not compatible with Babel v6+.\n\n## Usage\n\nIndentation will be removed from all strings tagged with `dedent` tag (you can also use `dedent` as a function, if you need to use your own tag).\n\n```js\nexpect(dedent`Line #1\n\tLine #2\n\tLine #3`).to.equal('Line #1\\nLine #2\\nLine #3');\n\n// Leading/trailing line break is removed.\nexpect(\n\tdedent`\n\tLine #1\n\tLine #2\n\tLine #3\n\t`\n).to.equal('Line #1\\nLine #2\\nLine #3');\n\n// No more than one leading/trailing line break is removed.\nexpect(\n\tdedent`\n\n\tLine #1\n\tLine #2\n\tLine #3\n\n\t`\n).to.equal('\\nLine #1\\nLine #2\\nLine #3\\n');\n\n// Only the \"base\" indentation is removed.\nexpect(\n\tdedent`\n\tLine #1\n\t\tLine #2\n\t\t\tLine #3\n\t`\n).to.equal('Line #1\\n\\tLine #2\\n\\t\\tLine #3');\n\n// The last line is ignored if it doesn't contain anything else than whitespace.\nexpect(\n\tfunction () {\n\t\treturn dedent`\n\t\t\tLine #1\n\t\t\tLine #2\n\t\t\tLine #3\n\t\t`;\n\t}()\n).to.equal('Line #1\\nLine #2\\nLine #3');\n\n// Escaped characters are ignored.\nexpect(\n\tdedent`\n\t\\tLine #1\n\t\\tLine #2\n\t\\tLine #3\n\t`\n).to.equal('\\tLine #1\\n\\tLine #2\\n\\tLine #3');\n```\n\n## License\nCopyright (c) 2015 - 2020 Martin Kolárik. Released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinkolarik%2Fbabel-plugin-dedent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinkolarik%2Fbabel-plugin-dedent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinkolarik%2Fbabel-plugin-dedent/lists"}