{"_id":"@depup/mdast-util-gfm","name":"@depup/mdast-util-gfm","dist-tags":{"latest":"3.1.0-depup.0"},"versions":{"3.1.0-depup.0":{"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"bugs":{"url":"https://github.com/syntax-tree/mdast-util-gfm/issues"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{"mdast-util-from-markdown":"^2.0.3","mdast-util-gfm-autolink-literal":"^2.0.1","mdast-util-gfm-footnote":"^2.1.0","mdast-util-gfm-strikethrough":"^2.0.0","mdast-util-gfm-table":"^2.0.0","mdast-util-gfm-task-list-item":"^2.0.0","mdast-util-to-markdown":"^2.1.2"},"description":"[DepUp] mdast extension to parse and serialize GFM (GitHub Flavored Markdown)","devDependencies":{"@types/node":"^22.0.0","c8":"^10.0.0","github-slugger":"^2.0.0","hast-util-to-html":"^9.0.0","mdast-util-to-hast":"^13.0.0","micromark-extension-gfm":"^3.0.0","prettier":"^3.0.0","remark-cli":"^12.0.0","remark-preset-wooorm":"^11.0.0","type-coverage":"^2.0.0","typescript":"^5.0.0","undici":"^7.0.0","xo":"^0.60.0"},"exports":"./index.js","funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"keywords":["depup","dependency-bumped","updated-deps","mdast-util-gfm","autolink","gfm","github","markdown","markup","mdast-util","mdast","strikethrough","table","tagfilter","tasklist","unist","utility","util"],"license":"MIT","name":"@depup/mdast-util-gfm","prettier":{"bracketSpacing":false,"semi":false,"singleQuote":true,"tabWidth":2,"trailingComma":"none","useTabs":false},"remarkConfig":{"plugins":["remark-preset-wooorm"]},"repository":{"type":"git","url":"git+https://github.com/syntax-tree/mdast-util-gfm.git"},"scripts":{"build":"tsc --build --clean && tsc --build && type-coverage","crawl":"node --conditions development script/crawl-tests.js","format":"remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix","test-api-prod":"node --conditions production test/index.js","test-api-dev":"node --conditions development test/index.js","test-api":"npm run test-api-dev && npm run test-api-prod","test-coverage":"c8 --100 --reporter lcov -- npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"sideEffects":false,"typeCoverage":{"atLeast":100,"strict":true},"type":"module","version":"3.1.0-depup.0","xo":{"overrides":[{"files":["**/*.d.ts"],"rules":{"@typescript-eslint/array-type":["error",{"default":"generic"}],"@typescript-eslint/ban-types":["error",{"extendDefaults":true}],"@typescript-eslint/consistent-type-definitions":["error","interface"]}},{"files":"test/**/*.js","rules":{"no-await-in-loop":"off"}}],"prettier":true},"depup":{"changes":{"mdast-util-from-markdown":{"from":"^2.0.0","to":"^2.0.3"},"mdast-util-gfm-autolink-literal":{"from":"^2.0.0","to":"^2.0.1"},"mdast-util-gfm-footnote":{"from":"^2.0.0","to":"^2.1.0"},"mdast-util-to-markdown":{"from":"^2.0.0","to":"^2.1.2"}},"depsUpdated":4,"originalPackage":"mdast-util-gfm","originalVersion":"3.1.0","processedAt":"2026-03-17T16:37:46.651Z","smokeTest":"passed"},"gitHead":"4696d3349a039de4b13745770d87bbf7fd3d5b12","types":"./index.d.ts","_id":"@depup/mdast-util-gfm@3.1.0-depup.0","homepage":"https://github.com/syntax-tree/mdast-util-gfm#readme","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-R2lVESQycrVOkQmnZFMxo8oDr6hDNfwKBjZzQYMfRzn9GSQVknXJlLtnV3I8JxOvTHCMi+nRtucV/ZdX/I7i8w==","shasum":"452bf65d018a839838716f933c26a286d9c688f4","tarball":"https://registry.npmjs.org/@depup/mdast-util-gfm/-/mdast-util-gfm-3.1.0-depup.0.tgz","fileCount":10,"unpackedSize":24217,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDU88zrYGlyQh3lqA8+qAsxwPnLL0mQpVu3mT8xwxaBtgIgBcWEA1wbMM/UHEspyt5N2urQ5ZqSViiHuuBUjbDq30c="}]},"_npmUser":{"name":"chiefmikey","email":"wolfemikl@gmail.com"},"directories":{},"maintainers":[{"name":"chiefmikey","email":"wolfemikl@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mdast-util-gfm_3.1.0-depup.0_1773765468620_0.6941325966958025"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-17T16:37:48.515Z","3.1.0-depup.0":"2026-03-17T16:37:48.760Z","modified":"2026-03-17T16:37:48.972Z"},"maintainers":[{"name":"chiefmikey","email":"wolfemikl@gmail.com"}],"description":"[DepUp] mdast extension to parse and serialize GFM (GitHub Flavored Markdown)","homepage":"https://github.com/syntax-tree/mdast-util-gfm#readme","keywords":["depup","dependency-bumped","updated-deps","mdast-util-gfm","autolink","gfm","github","markdown","markup","mdast-util","mdast","strikethrough","table","tagfilter","tasklist","unist","utility","util"],"repository":{"type":"git","url":"git+https://github.com/syntax-tree/mdast-util-gfm.git"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"bugs":{"url":"https://github.com/syntax-tree/mdast-util-gfm/issues"},"license":"MIT","readme":"# mdast-util-gfm\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][] extensions to parse and serialize [GFM][] (autolink literals,\nfootnotes, strikethrough, tables, tasklists).\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When to use this](#when-to-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`gfmFromMarkdown()`](#gfmfrommarkdown)\n  * [`gfmToMarkdown(options?)`](#gfmtomarkdownoptions)\n  * [`Options`](#options)\n* [HTML](#html)\n* [Syntax](#syntax)\n* [Syntax tree](#syntax-tree)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Related](#related)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package contains two extensions that add support for GFM syntax in\nmarkdown to [mdast][]: autolink literals (`www.x.com`), footnotes (`[^1]`),\nstrikethrough (`~~stuff~~`), tables (`| cell |…`), and tasklists (`* [x]`).\nThese extensions plug into\n[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing\nGFM in markdown into a syntax tree) and\n[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing\nGFM in syntax trees to markdown).\n\n## When to use this\n\nThis project is useful when you want to support the same features that GitHub\ndoes in files in a repo, Gists, and several other places.\nUsers frequently believe that some of these extensions, specifically autolink\nliterals and tables, are part of normal markdown, so using `mdast-util-gfm` will\nhelp match your implementation to their understanding of markdown.\nThere are several edge cases where GitHub’s implementation works in unexpected\nways or even different than described in their spec, so *writing* in GFM is not\nalways the best choice.\n\nYou can use these extensions when you are working with\n`mdast-util-from-markdown` and `mdast-util-to-markdown` already.\n\nWhen working with `mdast-util-from-markdown`, you must combine this package\nwith [`micromark-extension-gfm`][extension].\n\nInstead of this package, you can also use the extensions separately:\n\n* [`mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal)\n  — support GFM autolink literals\n* [`mdast-util-gfm-footnote`](https://github.com/syntax-tree/mdast-util-gfm-footnote)\n  — support GFM footnotes\n* [`mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough)\n  — support GFM strikethrough\n* [`mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table)\n  — support GFM tables\n* [`mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item)\n  — support GFM tasklists\n\nA different utility, [`mdast-util-frontmatter`][mdast-util-frontmatter], adds\nsupport for frontmatter.\nGitHub supports YAML frontmatter for files in repos and Gists but they don’t\ntreat it as part of GFM.\n\nAll these packages are used in [`remark-gfm`][remark-gfm], which\nfocusses on making it easier to transform content by abstracting these\ninternals away.\n\nThis utility does not handle how markdown is turned to HTML.\nThat’s done by [`mdast-util-to-hast`][mdast-util-to-hast].\nIf your content is not in English, you should configure that utility.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install mdast-util-gfm\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {gfmFromMarkdown, gfmToMarkdown} from 'https://esm.sh/mdast-util-gfm@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {gfmFromMarkdown, gfmToMarkdown} from 'https://esm.sh/mdast-util-gfm@3?bundle'\n</script>\n```\n\n## Use\n\nSay our document `example.md` contains:\n\n```markdown\n# GFM\n\n## Autolink literals\n\nwww.example.com, https://example.com, and contact@example.com.\n\n## Footnote\n\nA note[^1]\n\n[^1]: Big note.\n\n## Strikethrough\n\n~one~ or ~~two~~ tildes.\n\n## Table\n\n| a | b  |  c |  d  |\n| - | :- | -: | :-: |\n\n## Tasklist\n\n* [ ] to do\n* [x] done\n```\n\n…and our module `example.js` looks as follows:\n\n```js\nimport fs from 'node:fs/promises'\nimport {fromMarkdown} from 'mdast-util-from-markdown'\nimport {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm'\nimport {toMarkdown} from 'mdast-util-to-markdown'\nimport {gfm} from 'micromark-extension-gfm'\n\nconst value = await fs.readFile('example.md', 'utf8')\n\nconst tree = fromMarkdown(value, {\n  extensions: [gfm()],\n  mdastExtensions: [gfmFromMarkdown()]\n})\n\nconsole.log(tree)\n\nconst result = toMarkdown(tree, {extensions: [gfmToMarkdown()]})\n\nconsole.log(result)\n```\n\n…now running `node example.js` yields (positional info removed for brevity):\n\n```js\n{\n  type: 'root',\n  children: [\n    {type: 'heading', depth: 1, children: [{type: 'text', value: 'GFM'}]},\n    {\n      type: 'heading',\n      depth: 2,\n      children: [{type: 'text', value: 'Autolink literals'}]\n    },\n    {\n      type: 'paragraph',\n      children: [\n        {\n          type: 'link',\n          title: null,\n          url: 'http://www.example.com',\n          children: [{type: 'text', value: 'www.example.com'}]\n        },\n        {type: 'text', value: ', '},\n        {\n          type: 'link',\n          title: null,\n          url: 'https://example.com',\n          children: [{type: 'text', value: 'https://example.com'}]\n        },\n        {type: 'text', value: ', and '},\n        {\n          type: 'link',\n          title: null,\n          url: 'mailto:contact@example.com',\n          children: [{type: 'text', value: 'contact@example.com'}]\n        },\n        {type: 'text', value: '.'}\n      ]\n    },\n    {type: 'heading', depth: 2, children: [{type: 'text', value: 'Footnote'}]},\n    {\n      type: 'paragraph',\n      children: [\n        {type: 'text', value: 'A note'},\n        {type: 'footnoteReference', identifier: '1', label: '1'}\n      ]\n    },\n    {\n      type: 'footnoteDefinition',\n      identifier: '1',\n      label: '1',\n      children: [\n        {type: 'paragraph', children: [{type: 'text', value: 'Big note.'}]}\n      ]\n    },\n    {\n      type: 'heading',\n      depth: 2,\n      children: [{type: 'text', value: 'Strikethrough'}]\n    },\n    {\n      type: 'paragraph',\n      children: [\n        {\n          type: 'delete',\n          children: [{type: 'text', value: 'one'}]\n        },\n        {type: 'text', value: ' or '},\n        {\n          type: 'delete',\n          children: [{type: 'text', value: 'two'}]\n        },\n        {type: 'text', value: ' tildes.'}\n      ]\n    },\n    {type: 'heading', depth: 2, children: [{type: 'text', value: 'Table'}]},\n    {\n      type: 'table',\n      align: [null, 'left', 'right', 'center'],\n      children: [\n        {\n          type: 'tableRow',\n          children: [\n            {type: 'tableCell', children: [{type: 'text', value: 'a'}]},\n            {type: 'tableCell', children: [{type: 'text', value: 'b'}]},\n            {type: 'tableCell', children: [{type: 'text', value: 'c'}]},\n            {type: 'tableCell', children: [{type: 'text', value: 'd'}]}\n          ]\n        }\n      ]\n    },\n    {type: 'heading', depth: 2, children: [{type: 'text', value: 'Tasklist'}]},\n    {\n      type: 'list',\n      ordered: false,\n      start: null,\n      spread: false,\n      children: [\n        {\n          type: 'listItem',\n          spread: false,\n          checked: false,\n          children: [\n            {type: 'paragraph', children: [{type: 'text', value: 'to do'}]}\n          ]\n        },\n        {\n          type: 'listItem',\n          spread: false,\n          checked: true,\n          children: [\n            {type: 'paragraph', children: [{type: 'text', value: 'done'}]}\n          ]\n        }\n      ]\n    }\n  ]\n}\n```\n\n```markdown\n# GFM\n\n## Autolink literals\n\n[www.example.com](http://www.example.com), <https://example.com>, and <contact@example.com>.\n\n## Footnote\n\nA note[^1]\n\n[^1]: Big note.\n\n## Strikethrough\n\n~~one~~ or ~~two~~ tildes.\n\n## Table\n\n| a | b  |  c |  d  |\n| - | :- | -: | :-: |\n\n## Tasklist\n\n*   [ ] to do\n*   [x] done\n```\n\n## API\n\nThis package exports the identifiers [`gfmFromMarkdown`][api-gfm-from-markdown]\nand [`gfmToMarkdown`][api-gfm-to-markdown].\nThere is no default export.\n\n### `gfmFromMarkdown()`\n\nCreate an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown]\nto enable GFM (autolink literals, footnotes, strikethrough, tables, tasklists).\n\n###### Returns\n\nExtension for `mdast-util-from-markdown` to enable GFM\n([`Array<FromMarkdownExtension>`][from-markdown-extension]).\n\n### `gfmToMarkdown(options?)`\n\nCreate an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown]\nto enable GFM (autolink literals, footnotes, strikethrough, tables, tasklists).\n\n###### Parameters\n\n* `options` ([`Options`][api-options])\n  — configuration\n\n###### Returns\n\nExtension for `mdast-util-to-markdown` to enable GFM\n([`Array<ToMarkdownExtension>`][to-markdown-extension]).\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n* `firstLineBlank` (`boolean`, default: `false`)\n  — use a blank line for the first line of footnote definitions\n* `stringLength` (`((value: string) => number)`, default: `s => s.length`)\n  — function to detect the length of table cell content, used when aligning\n  the delimiters between cells\n* `tableCellPadding` (`boolean`, default: `true`)\n  — whether to add a space of padding between delimiters and cells\n* `tablePipeAlign` (`boolean`, default: `true`)\n  — whether to align the delimiters\n\n## HTML\n\nThis utility does not handle how markdown is turned to HTML.\nThat’s done by [`mdast-util-to-hast`][mdast-util-to-hast].\n\n## Syntax\n\nSee [Syntax in `micromark-extension-gfm`][syntax].\n\n## Syntax tree\n\nThis utility combines several mdast utilities.\nSee their readmes for the node types supported in the tree:\n\n* [`mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal#syntax-tree)\n  — GFM autolink literals\n* [`mdast-util-gfm-footnote`](https://github.com/syntax-tree/mdast-util-gfm-footnote#syntax-tree)\n  — GFM footnotes\n* [`mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough#syntax-tree)\n  — GFM strikethrough\n* [`mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table#syntax-tree)\n  — GFM tables\n* [`mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item#syntax-tree)\n  — GFM tasklists\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type [`Options`][api-options].\n\nThe `Delete`, `FootnoteDefinition`, `FootnoteReference`, `Table`, `TableRow`,\nand `TableCell` types of the mdast nodes are exposed from `@types/mdast`.\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-util-gfm@^3`,\ncompatible with Node.js 16.\n\n## Related\n\n* [`remark-gfm`][remark-gfm]\n  — remark plugin to support GFM\n* [`micromark-extension-gfm`][extension]\n  — micromark extension to parse GFM\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<!-- Definitions -->\n\n[api-gfm-from-markdown]: #gfmfrommarkdown\n\n[api-gfm-to-markdown]: #gfmtomarkdownoptions\n\n[api-options]: #options\n\n[author]: https://wooorm.com\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[build]: https://github.com/syntax-tree/mdast-util-gfm/actions\n\n[build-badge]: https://github.com/syntax-tree/mdast-util-gfm/workflows/main/badge.svg\n\n[chat]: https://github.com/syntax-tree/unist/discussions\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md\n\n[collective]: https://opencollective.com/unified\n\n[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md\n\n[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm.svg\n\n[downloads]: https://www.npmjs.com/package/mdast-util-gfm\n\n[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm.svg\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[extension]: https://github.com/micromark/micromark-extension-gfm\n\n[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension\n\n[gfm]: https://github.github.com/gfm/\n\n[health]: https://github.com/syntax-tree/.github\n\n[license]: license\n\n[mdast]: https://github.com/syntax-tree/mdast\n\n[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown\n\n[mdast-util-frontmatter]: https://github.com/syntax-tree/mdast-util-frontmatter\n\n[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast\n\n[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[remark-gfm]: https://github.com/remarkjs/remark-gfm\n\n[size]: https://bundlejs.com/?q=mdast-util-gfm\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[support]: https://github.com/syntax-tree/.github/blob/main/support.md\n\n[syntax]: https://github.com/micromark/micromark-extension-gfm#syntax\n\n[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options\n\n[typescript]: https://www.typescriptlang.org\n","readmeFilename":"readme.md","_rev":"1-2926fe286fa51ca05064d6e0f018b19c"}