Package Exports
- mdast-util-definitions
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mdast-util-definitions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
mdast-util-definitions

Get definitions in MDAST nodes by identifier
. Supports funky
keys, like __proto__
or toString
.
Installation
npm:
npm install mdast-util-definitions
Usage
var remark = require('remark');
var definitions = require('mdast-util-definitions');
var ast = remark().parse('[example]: http://example.com "Example"');
var definition = definitions(ast);
definition('example');
// {type: 'definition', 'title': 'Example', ...}
definition('foo');
// null
API
definitions(node[, options])
Create a cache of all definition
s in node
.
options
commonmark
(boolean
, default: false) — Turn on to use CommonMark precedence: ignore later found definitions for duplicate definitions. The default behaviour is to prefer the last found definition.
Returns
definition(identifier)
Parameters
identifier
(string
) — Identifier of definition.
Returns
Node?
— Definition, if found.