{"id":28516103,"url":"https://github.com/dev-build-deploy/comment-it","last_synced_at":"2026-03-05T10:02:56.696Z","repository":{"id":177692186,"uuid":"657136781","full_name":"dev-build-deploy/comment-it","owner":"dev-build-deploy","description":"Source file comment management library","archived":false,"fork":false,"pushed_at":"2025-10-14T16:08:17.000Z","size":468,"stargazers_count":0,"open_issues_count":7,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-17T03:55:32.771Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dev-build-deploy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSES/CC0-1.0.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["Kevin-de-Jong"]}},"created_at":"2023-06-22T11:54:30.000Z","updated_at":"2025-07-01T19:55:53.000Z","dependencies_parsed_at":"2024-01-17T21:56:45.529Z","dependency_job_id":"4375ebc0-22fb-41fa-9f74-b879a22454fd","html_url":"https://github.com/dev-build-deploy/comment-it","commit_stats":null,"previous_names":["dev-build-deploy/comment-it"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/dev-build-deploy/comment-it","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-build-deploy%2Fcomment-it","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-build-deploy%2Fcomment-it/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-build-deploy%2Fcomment-it/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-build-deploy%2Fcomment-it/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev-build-deploy","download_url":"https://codeload.github.com/dev-build-deploy/comment-it/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-build-deploy%2Fcomment-it/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30118932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T09:35:22.236Z","status":"ssl_error","status_checked_at":"2026-03-05T09:35:20.028Z","response_time":93,"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":"2025-06-09T03:32:13.603Z","updated_at":"2026-03-05T10:02:56.634Z","avatar_url":"https://github.com/dev-build-deploy.png","language":"TypeScript","readme":"\u003c!--\nSPDX-FileCopyrightText: 2023 Kevin de Jong \u003cmonkaii@hotmail.com\u003e\nSPDX-License-Identifier: MIT\n--\u003e\n\n# CommentIt - Comment Extraction Library\n\nExtract comment blocks from your files.\n\n## Features\n\n* Simple to use\n* Extracts single- and multiline- comment blocks\n* Supports a range of [languages](./src/languages/languages.json) covering the top 25 languages used in GitHub (+ more)\n\n\u003c!-- Hee hee, hid a comment block in here --\u003e\n\n## Basic Usage\n\n```typescript\nimport { extractComments } from \"@dev-build-deploy/comment-it\";\n\nconst file = \"README.md\";\n\n// Check if the file is supported by CommentIt\nif (isSupported(file)) {\n  const config = {\n    /** Only consider comments in the first ..n lines */\n    maxLines: 20,\n    /** Group sequential singleline comments into a comment block */\n    groupSingleline: true,\n  };\n\n  // Retrieve each comment block using an iterator\n  for await (const comment of extractComments(file), /* OPTIONAL */ config) {\n    console.log(JSON.stringify(comment, null, 2));\n  }\n}\n```\n\nThe above example will result in:\n\n\u003c!-- REUSE-IgnoreStart --\u003e\n```json\n{\n  \"type\": \"multiline\",\n  \"format\": { \"start\": \"\u003c!--\", \"end\": \"--\u003e\"},\n  \"contents\": [\n    {\n      \"line\":   1,\n      \"column\": { \"start\": 0, \"end\":  4 },\n      \"raw\":    \"\u003c!--\",\n      \"value\":  \"\"\n    },\n    {\n      \"line\":   2,\n      \"column\": { \"start\": 0, \"end\": 64 },\n      \"raw\":    \"SPDX-FileCopyrightText: 2023 Kevin de Jong \u003cmonkaii@hotmail.com\u003e\",\n      \"value\":  \"SPDX-FileCopyrightText: 2023 Kevin de Jong \u003cmonkaii@hotmail.com\u003e\"\n    },\n    {\n      \"line\":   3,\n      \"column\": { \"start\": 0, \"end\": 41 },\n      \"raw\":    \"SPDX-License-Identifier: MIT\",\n      \"value\":  \"SPDX-License-Identifier: MIT\"\n    },\n    {\n      \"line\":  4,\n      \"column\": { \"start\": 0, \"end\":  3 },\n      \"raw\": \"--\u003e\",\n      \"value\": \"\"\n    }\n  ]\n}\n\n{\n  \"type\": \"multiline\",\n  \"format\": { \"start\": \"\u003c!--\", \"end\": \"--\u003e\" },\n  \"contents\": [\n    {\n      \"line\": 16,\n      \"column\": { \"start\": 0, \"end\": 45 },\n      \"raw\": \"\u003c!-- Hee hee, hid a comment block in here --\u003e\",\n      \"value\": \"Hee hee, hid a comment block in here\"\n    }\n  ]\n}\n```\n\u003c!-- REUSE-IgnoreEnd --\u003e\n\n## Custom Language(s)\n\nYou can use the `addLanguage()` function to add new languages to the validation set:\n\n```typescript\nimport { addLanguage } from \"@dev-build-deploy/comment-it\";\n\naddLanguage({\n  name: \"Pingu Language\",\n  filenames: [\".pingu\"],\n  extensions: [\".noot\"],\n  singleline: \"{%NOOTNOOT%}\",\n});\n```\n\nThe same function can also be used to override a (default) configuration. For example,\nthe following code snippet replaces the comment prefix from `;` to `#` for files with\nthe`.ini` file extension:\n\n```typescript\nimport { addLanguage } from \"@dev-build-deploy/comment-it\";\n\naddLanguage({\n  name: \"Custom ini\",\n  extensions: [\".ini\"],\n  singleline: \"#\",\n});\n```\n\n## Contributing\n\nIf you have suggestions for how comment-it could be improved, or want to report a bug, open an issue! We'd love all and any contributions.\n\nFor more, check out the [Contributing Guide](CONTRIBUTING.md).\n\n## License\n\n- [MIT](./LICENSES/MIT.txt) © 2023 Kevin de Jong \\\u003cmonkaii@hotmail.com\\\u003e\n\n[SemVer 2.0.0]: https://semver.org\n","funding_links":["https://github.com/sponsors/Kevin-de-Jong"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-build-deploy%2Fcomment-it","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev-build-deploy%2Fcomment-it","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-build-deploy%2Fcomment-it/lists"}