{"id":15871890,"url":"https://github.com/ticky/doc-chomp","last_synced_at":"2026-02-25T10:42:59.974Z","repository":{"id":38272698,"uuid":"71307325","full_name":"ticky/doc-chomp","owner":"ticky","description":"🍴 Doc Chomp chomps on your document literals","archived":false,"fork":false,"pushed_at":"2026-02-20T18:30:15.000Z","size":483,"stargazers_count":2,"open_issues_count":19,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2026-02-20T23:42:06.475Z","etag":null,"topics":[],"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/ticky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-10-19T01:37:26.000Z","updated_at":"2024-06-14T03:18:57.000Z","dependencies_parsed_at":"2023-02-05T02:00:16.957Z","dependency_job_id":"79edbc90-be44-4891-a318-16b91efbec1c","html_url":"https://github.com/ticky/doc-chomp","commit_stats":{"total_commits":86,"total_committers":3,"mean_commits":"28.666666666666668","dds":"0.18604651162790697","last_synced_commit":"7907d5cae427481ea6b42100cddff2f166071a03"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ticky/doc-chomp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticky%2Fdoc-chomp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticky%2Fdoc-chomp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticky%2Fdoc-chomp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticky%2Fdoc-chomp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ticky","download_url":"https://codeload.github.com/ticky/doc-chomp/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticky%2Fdoc-chomp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29818294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-10-06T01:00:43.766Z","updated_at":"2026-02-25T10:42:59.957Z","avatar_url":"https://github.com/ticky.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🍴 Doc Chomp\n\n[![npm](https://img.shields.io/npm/v/doc-chomp.svg?maxAge=2592000)](https://www.npmjs.com/package/doc-chomp) ![doc-chomp](https://img.shields.io/npm/l/doc-chomp.svg?maxAge=2592000) [![Build Status](https://travis-ci.org/ticky/doc-chomp.svg?branch=develop)](https://travis-ci.org/ticky/doc-chomp) [![codecov](https://codecov.io/gh/ticky/doc-chomp/branch/develop/graph/badge.svg)](https://codecov.io/gh/ticky/doc-chomp)\n\nDoc Chomp chomps on your document literals\n\n## Usage\n\nDoc Chomp is useful for keeping nice indentation outside ES6 template literals, while making them internally clean and consistent.\n\n### Automatic\n\nThe simplest way to use Doc Chomp is to tag a string!\n\n```javascript\nconst DocChomp = require('doc-chomp');\n\nlet chompedString = DocChomp`\n  This string will be trimmed such that all indentation matches this line\n\n  * Extra indentation is supported just fine\n    * No problem! 👌🏼\n\n  The line after the DocChomp call shouldn't be used, or Doc Chomp will complain!\n  `\n\nfunction compareStrings() {\n  if (chompedString) {\n    return chompedString === DocChomp`\n      This string will be trimmed such that all indentation matches this line\n\n      * Extra indentation is supported just fine\n        * No problem! 👌🏼\n\n      The line after the DocChomp call shouldn't be used, or Doc Chomp will complain!\n      `;\n  }\n}\n\ncompareStrings(); // true!\n```\n\nIn this example, `chompedString` will have two space characters trimmed from each line, and the other one will have six removed from each line.\n\nWith this usage, the first blank line (adjacent to `DocChomp`) is removed, and no text may be added on that line as DocChomp. If text was accepted here, Doc Chomp couldn't make a good choice about spacing! If you need to put text on that line, you can use the manual modes below!\n\n### Manual\n\nIn both of these modes, note that if the line `DocChomp` is on is blank, it will be omitted from the output, and line numbers begin at the next line.\n\n#### Indentation line\n\nIf passed a number, Doc Chomp will detect the indentation from that line of the input.\n\n```javascript\nfunction mcGuffin() {\n  if (this.glazed) {\n    return chompedString === DocChomp(2)`This string will have six space characters removed from the start of each line\n\n      * Because this line is defined as line 2, and used for indentation detection\n        * 👌🏼\n      `;\n  } else {\n    return chompedString === DocChomp(2)`\n      This is the \"first\" line (line 0), according to Doc Chomp, because the above line is blank.\n\n      * Which means this is line 2, and used for indentation detection\n        * No problem! 👌🏼\n      `;\n  }\n}\n```\n\n#### Indentation string\n\nIf passed a string, Doc Chomp will remove exactly that indentation from each line.\n\n```javascript\nfunction mcGuffin() {\n  if (this.glazed) {\n    return chompedString === DocChomp('      ')`This string will have six space characters removed from the start of each line\n\n      * Extra indentation is supported just fine\n        * No problem! 👌🏼\n      `;\n  } else {\n    return chompedString === DocChomp('\\t\\t\\t')`This string will have three tab characters removed from the start of each line\n\n\t\t\t* Extra indentation is supported just fine\n\t\t\t\t* No problem! 👌🏼\n\t\t\t`;\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fticky%2Fdoc-chomp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fticky%2Fdoc-chomp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fticky%2Fdoc-chomp/lists"}