Gathering detailed insights and metrics for mdast-util-gfm-bn
Gathering detailed insights and metrics for mdast-util-gfm-bn
npm install mdast-util-gfm-bn
Typescript
Module System
Node Version
NPM Version
61.9
Supply Chain
98
Quality
75.1
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
282
Last Day
3
Last Week
6
Last Month
18
Last Year
147
20 Stars
64 Commits
6 Forks
9 Watching
1 Branches
11 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.0
Package Id
mdast-util-gfm-bn@2.0.0
Unpacked Size
13.93 kB
Size
4.33 kB
File Count
4
NPM Version
9.6.7
Node Version
18.17.0
Publised On
28 Dec 2023
Cumulative downloads
Total Downloads
Last day
0%
3
Compared to previous day
Last week
-25%
6
Compared to previous week
Last month
157.1%
18
Compared to previous month
Last year
8.9%
147
Compared to previous year
5
Extension for mdast-util-from-markdown
and/or
mdast-util-to-markdown
to support GitHub flavored markdown in
mdast.
When parsing (from-markdown
), must be combined with
micromark-extension-gfm
.
Use this if you’re dealing with the AST manually and need all of GFM.
It’s probably nicer to use remark-gfm
with
remark, which includes this but provides a nicer interface and
makes it easier to combine with hundreds of plugins.
Alternatively, the extensions can be used separately:
syntax-tree/mdast-util-gfm-autolink-literal
— support GFM autolink literalssyntax-tree/mdast-util-gfm-footnote
— support GFM footnotessyntax-tree/mdast-util-gfm-strikethrough
— support GFM strikethroughsyntax-tree/mdast-util-gfm-table
— support GFM tablessyntax-tree/mdast-util-gfm-task-list-item
— support GFM tasklistsThis package is ESM only:
Node 12+ is needed to use it and it must be import
ed instead of require
d.
npm:
1npm install mdast-util-gfm
Say we have the following file, example.md
:
1# GFM 2 3## Autolink literals 4 5www.example.com, https://example.com, and contact@example.com. 6 7## Footnote 8 9A note[^1] 10 11[^1]: Big note. 12 13## Strikethrough 14 15~one~ or ~~two~~ tildes. 16 17## Table 18 19| a | b | c | d | 20| - | :- | -: | :-: | 21 22## Tasklist 23 24* [ ] to do 25* [x] done
And our module, example.js
, looks as follows:
1import fs from 'node:fs' 2import {fromMarkdown} from 'mdast-util-from-markdown' 3import {toMarkdown} from 'mdast-util-to-markdown' 4import {gfm} from 'micromark-extension-gfm' 5import {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm' 6 7const doc = fs.readFileSync('example.md') 8 9const tree = fromMarkdown(doc, { 10 extensions: [gfm()], 11 mdastExtensions: [gfmFromMarkdown()] 12}) 13 14console.log(tree) 15 16const out = toMarkdown(tree, {extensions: [gfmToMarkdown()]}) 17 18console.log(out)
Now, running node example
yields:
1{ 2 type: 'root', 3 children: [ 4 {type: 'heading', depth: 1, children: [{type: 'text', value: 'GFM'}]}, 5 { 6 type: 'heading', 7 depth: 2, 8 children: [{type: 'text', value: 'Autolink literals'}] 9 }, 10 { 11 type: 'paragraph', 12 children: [ 13 { 14 type: 'link', 15 title: null, 16 url: 'http://www.example.com', 17 children: [{type: 'text', value: 'www.example.com'}] 18 }, 19 {type: 'text', value: ', '}, 20 { 21 type: 'link', 22 title: null, 23 url: 'https://example.com', 24 children: [{type: 'text', value: 'https://example.com'}] 25 }, 26 {type: 'text', value: ', and '}, 27 { 28 type: 'link', 29 title: null, 30 url: 'mailto:contact@example.com', 31 children: [{type: 'text', value: 'contact@example.com'}] 32 }, 33 {type: 'text', value: '.'} 34 ] 35 }, 36 {type: 'heading', depth: 2, children: [{type: 'text', value: 'Footnote'}]}, 37 { 38 type: 'paragraph', 39 children: [ 40 {type: 'text', value: 'A note'}, 41 {type: 'footnoteReference', identifier: '1', label: '1'} 42 ] 43 }, 44 { 45 type: 'footnoteDefinition', 46 identifier: '1', 47 label: '1', 48 children: [ 49 {type: 'paragraph', children: [{type: 'text', value: 'Big note.'}]} 50 ] 51 }, 52 { 53 type: 'heading', 54 depth: 2, 55 children: [{type: 'text', value: 'Strikethrough'}] 56 }, 57 { 58 type: 'paragraph', 59 children: [ 60 { 61 type: 'delete', 62 children: [{type: 'text', value: 'one'}] 63 }, 64 {type: 'text', value: ' or '}, 65 { 66 type: 'delete', 67 children: [{type: 'text', value: 'two'}] 68 }, 69 {type: 'text', value: ' tildes.'} 70 ] 71 }, 72 {type: 'heading', depth: 2, children: [{type: 'text', value: 'Table'}]}, 73 { 74 type: 'table', 75 align: [null, 'left', 'right', 'center'], 76 children: [ 77 { 78 type: 'tableRow', 79 children: [ 80 {type: 'tableCell', children: [{type: 'text', value: 'a'}]}, 81 {type: 'tableCell', children: [{type: 'text', value: 'b'}]}, 82 {type: 'tableCell', children: [{type: 'text', value: 'c'}]}, 83 {type: 'tableCell', children: [{type: 'text', value: 'd'}]} 84 ] 85 } 86 ] 87 }, 88 {type: 'heading', depth: 2, children: [{type: 'text', value: 'Tasklist'}]}, 89 { 90 type: 'list', 91 ordered: false, 92 start: null, 93 spread: false, 94 children: [ 95 { 96 type: 'listItem', 97 spread: false, 98 checked: false, 99 children: [ 100 {type: 'paragraph', children: [{type: 'text', value: 'to do'}]} 101 ] 102 }, 103 { 104 type: 'listItem', 105 spread: false, 106 checked: true, 107 children: [ 108 {type: 'paragraph', children: [{type: 'text', value: 'done'}]} 109 ] 110 } 111 ] 112 } 113 ] 114}
1# GFM 2 3## Autolink literals 4 5[www.example.com](http://www.example.com), <https://example.com>, and <contact@example.com>. 6 7## Footnote 8 9A note[^1] 10 11[^1]: Big note. 12 13## Strikethrough 14 15~~one~~ or ~~two~~ tildes. 16 17## Table 18 19| a | b | c | d | 20| - | :- | -: | :-: | 21 22## Tasklist 23 24* [ ] to do 25* [x] done
This package exports the following identifiers: gfmFromMarkdown
,
gfmToMarkdown
.
There is no default export.
gfmFromMarkdown()
gfmToMarkdown(options?)
Support GFM.
The export of fromMarkdown
is a function that can be called and returns an
extension for mdast-util-from-markdown
.
The export of toMarkdown
is a function that can be called with options and
returns an extension for mdast-util-to-markdown
.
options
Passed as options
to mdast-util-gfm-table
.
remarkjs/remark
— markdown processor powered by pluginsremarkjs/remark-gfm
— remark plugin to support GFMmicromark/micromark
— the smallest commonmark-compliant markdown parser that existsmicromark/micromark-extension-gfm
— micromark extension to parse GFMsyntax-tree/mdast-util-from-markdown
— mdast parser using micromark
to create mdast from markdownsyntax-tree/mdast-util-to-markdown
— mdast serializer to create markdown from mdastSee contributing.md
in syntax-tree/.github
for ways to get
started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More