Gathering detailed insights and metrics for mdast-util-definitions
Gathering detailed insights and metrics for mdast-util-definitions
Gathering detailed insights and metrics for mdast-util-definitions
Gathering detailed insights and metrics for mdast-util-definitions
utility to find definition nodes in an mdast tree
npm install mdast-util-definitions
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
11 Stars
141 Commits
1 Forks
10 Watching
1 Branches
11 Contributors
Updated on 02 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-1.4%
1,136,349
Compared to previous day
Last week
3.9%
5,920,680
Compared to previous week
Last month
10.9%
24,836,816
Compared to previous month
Last year
-2.1%
333,908,258
Compared to previous year
mdast utility to find definitions by identifier
.
This package is a tiny utility that lets you find definitions.
This utility can be useful because definitions can occur after the things that reference them. It’s small and protects against prototype pollution.
This package is ESM only. In Node.js (version 16+), install with npm:
1npm install mdast-util-definitions
In Deno with esm.sh
:
1import {definitions} from 'https://esm.sh/mdast-util-definitions@6'
In browsers with esm.sh
:
1<script type="module"> 2 import {definitions} from 'https://esm.sh/mdast-util-definitions@6?bundle' 3</script>
1import {definitions} from 'mdast-util-definitions' 2import {fromMarkdown} from 'mdast-util-from-markdown' 3 4const tree = fromMarkdown('[example]: https://example.com "Example"') 5 6const definition = definitions(tree) 7 8definition('example') 9// => {type: 'definition', 'title': 'Example', …} 10 11definition('foo') 12// => undefined
This package exports the identifier definitions
.
There is no default export.
definitions(tree)
Find definitions in tree
.
Uses CommonMark precedence, which means that earlier definitions are preferred over duplicate later definitions.
tree
(Node
)
— tree to checkGetter (GetDefinition
).
GetDefinition
Get a definition by identifier (TypeScript type).
identifier
(string
, optional)
— identifier of definitionDefinition corresponding to identifier
(Definition
) or
undefined
.
This package is fully typed with TypeScript.
It exports the additional type GetDefinition
.
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
mdast-util-definitions@^6
, compatible with Node.js 16.
Use of mdast-util-definitions
does not involve hast or user content so
there are no openings for cross-site scripting (XSS) attacks.
Additionally, safe guards are in place to protect against prototype poisoning.
unist-util-index
— index property values or computed keys to nodesSee 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 binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-18
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