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
mdast-util-definitions is also available as an AMD, CommonJS, and globals module, uncompressed and compressed.
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)
Create a cache of all definition
s in node
.
Parameters
node
(Node
) — Ancestor of definitions.
Returns
definition(identifier)
Parameters
identifier
(string
) — Identifier of definition.
Returns
Node?
— Definition, if found.