{"id":13339496,"url":"https://github.com/syntax-tree/mdast-comment-marker","last_synced_at":"2025-10-14T18:41:25.257Z","repository":{"id":57293489,"uuid":"50851654","full_name":"syntax-tree/mdast-comment-marker","owner":"syntax-tree","description":"utility to parse a comment marker in mdast","archived":false,"fork":false,"pushed_at":"2023-07-12T07:33:48.000Z","size":117,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-10-14T01:23:59.696Z","etag":null,"topics":["markdown","mdast","mdast-util","syntax-tree","unist","util"],"latest_commit_sha":null,"homepage":"https://unifiedjs.com","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/syntax-tree.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,"governance":null},"funding":{"github":"unifiedjs","open_collective":"unified"}},"created_at":"2016-02-01T16:11:21.000Z","updated_at":"2025-08-07T00:42:20.000Z","dependencies_parsed_at":"2023-10-21T00:30:18.507Z","dependency_job_id":null,"html_url":"https://github.com/syntax-tree/mdast-comment-marker","commit_stats":{"total_commits":99,"total_committers":4,"mean_commits":24.75,"dds":"0.030303030303030276","last_synced_commit":"89ed56a318dff8a5bbdb6526099a1ebd5a6ed95d"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/syntax-tree/mdast-comment-marker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fmdast-comment-marker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fmdast-comment-marker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fmdast-comment-marker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fmdast-comment-marker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syntax-tree","download_url":"https://codeload.github.com/syntax-tree/mdast-comment-marker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fmdast-comment-marker/sbom","scorecard":{"id":863471,"data":{"date":"2025-08-11","repo":{"name":"github.com/syntax-tree/mdast-comment-marker","commit":"44e67df88bf51ed2d80f6c54aedde7393ad8edff"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/bb.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/mdast-comment-marker/bb.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/mdast-comment-marker/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/mdast-comment-marker/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/mdast-comment-marker/main.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:15","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/bb.yml:1","Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/syntax-tree/.github/security.md:1","Info: Found linked content: github.com/syntax-tree/.github/security.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/syntax-tree/.github/security.md:1","Info: Found text in security policy: github.com/syntax-tree/.github/security.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T02:00:44.780Z","repository_id":57293489,"created_at":"2025-08-24T02:00:44.780Z","updated_at":"2025-08-24T02:00:44.780Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019547,"owners_count":26086750,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"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":["markdown","mdast","mdast-util","syntax-tree","unist","util"],"created_at":"2024-07-29T19:20:04.161Z","updated_at":"2025-10-14T18:41:25.234Z","avatar_url":"https://github.com/syntax-tree.png","language":"JavaScript","readme":"# mdast-comment-marker\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n[mdast][] utility to parse comment markers.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`commentMarker(value)`](#commentmarkervalue)\n    *   [`Marker`](#marker)\n    *   [`MarkerParameters`](#markerparameters)\n    *   [`MarkerParameterValue`](#markerparametervalue)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package is a utility that tries to parse a structured marker from a\ncomment.\n\n## When should I use this?\n\nComments are a hidden part of markdown, so they can be used as processing\ninstructions.\nFor example, this utility is used in [`remark-lint`][remark-lint] to control\nwhether lint rules are turned on or ignored, and by [`mdast-zone`][mdast-zone]\nto replace sections between two markers.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install mdast-comment-marker\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {commentMarker} from 'https://esm.sh/mdast-comment-marker@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {commentMarker} from 'https://esm.sh/mdast-comment-marker@3?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport {commentMarker} from 'mdast-comment-marker'\n\nconsole.log(commentMarker({type: 'html', value: '\u003c!--foo--\u003e'}));\n\nconsole.log(commentMarker({\n  type: 'html',\n  value: '\u003c!--foo bar baz=12.4 qux=\"test test\" quux=\\'false\\'--\u003e'\n}));\n\nconsole.log(commentMarker({type: 'html', value: '\u003c!doctype html\u003e'}));\n\n// Also supports MDX expressions:\nconsole.log(commentMarker({\n  type: 'mdxFlowExpression',\n  value: '/* lint disable heading-style */'\n}));\n```\n\nYields:\n\n```js\n{\n  name: 'foo',\n  attributes: '',\n  parameters: {},\n  node: { type: 'html', value: '\u003c!--foo--\u003e' }\n}\n{\n  name: 'foo',\n  attributes: `bar baz=12.4 qux=\"test test\" quux='false'`,\n  parameters: { bar: true, baz: 12.4, qux: 'test test', quux: false },\n  node: {\n    type: 'html',\n    value: `\u003c!--foo bar baz=12.4 qux=\"test test\" quux='false'--\u003e`\n  }\n}\nundefined\n{\n  name: 'lint',\n  attributes: 'disable heading-style',\n  parameters: { disable: true, 'heading-style': true },\n  node: {\n    type: 'mdxFlowExpression',\n    value: '/* lint disable heading-style */'\n  }\n}\n```\n\n## API\n\nThis package exports the identifier [`commentMarker`][api-comment-marker].\nThere is no default export.\n\n### `commentMarker(value)`\n\nParse a comment marker.\n\n###### Parameters\n\n*   `value` (`unknown`)\n    — thing to parse, typically [`Node`][node]\n\n###### Returns\n\nInfo ([`Marker`][api-marker]) when applicable or `undefined`.\n\n### `Marker`\n\nComment marker (TypeScript type).\n\n###### Properties\n\n*   `name` (`string`)\n    — name of marker\n*   `attributes` (`string`)\n    — value after name\n*   `parameters` ([`MarkerParameters`][api-marker-parameters])\n    — parsed attributes\n*   `node` ([`Node`][node])\n    — reference to given node\n\n### `MarkerParameters`\n\nParameters (TypeScript type).\n\n###### type\n\n```ts\ntype MarkerParameters = Record\u003cstring, MarkerParameterValue\u003e\n```\n\n### `MarkerParameterValue`\n\nValue (TypeScript type).\n\nIf it looks like a number (to JavaScript), it’s cast as number.\nThe strings `true` and `false` are turned into their corresponding\nbooleans.\nThe empty string is also considered the `true` boolean.\n\n###### type\n\n```ts\ntype MarkerParameterValue = number | string | boolean\n```\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nThis package exports the types [`Marker`][api-marker],\n[`MarkerParameters`][api-marker-parameters], and\n[`MarkerParameterValue`][api-marker-parameter-value]\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `mdast-comment-marker@^3`,\ncompatible with Node.js 16.\n\n## Security\n\nUse of `mdast-comment-marker` does not involve [hast][], user content, or change\nthe tree, so there are no openings for [cross-site scripting (XSS)][xss]\nattacks.\n\n## Related\n\n*   [`mdast-zone`](https://github.com/syntax-tree/mdast-zone)\n    — change or replace a section marked by comments\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for\nways to get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/syntax-tree/mdast-comment-marker/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/mdast-comment-marker/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-comment-marker.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/mdast-comment-marker\n\n[downloads-badge]: https://img.shields.io/npm/dm/mdast-comment-marker.svg\n\n[downloads]: https://www.npmjs.com/package/mdast-comment-marker\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size\u0026query=$.size.compressedSize\u0026url=https://deno.bundlejs.com/?q=mdast-comment-marker\n\n[size]: https://bundlejs.com/?q=mdast-comment-marker\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/syntax-tree/unist/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/syntax-tree/.github\n\n[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md\n\n[support]: https://github.com/syntax-tree/.github/blob/main/support.md\n\n[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md\n\n[mdast]: https://github.com/syntax-tree/mdast\n\n[node]: https://github.com/syntax-tree/unist#node\n\n[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[hast]: https://github.com/syntax-tree/hast\n\n[remark-lint]: https://github.com/remarkjs/remark-lint\n\n[mdast-zone]: https://github.com/syntax-tree/mdast-zone\n\n[api-comment-marker]: #commentmarkervalue\n\n[api-marker]: #marker\n\n[api-marker-parameters]: #markerparameters\n\n[api-marker-parameter-value]: #markerparametervalue\n","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Fmdast-comment-marker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyntax-tree%2Fmdast-comment-marker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Fmdast-comment-marker/lists"}