{"name":"mdast-util-definitions","version":"1.2.2","description":"Find definition nodes in mdast nodes","license":"MIT","keywords":["mdast","remark","markdown","node","definition","find","cache"],"dependencies":{"unist-util-visit":"^1.0.0"},"repository":{"type":"git","url":"git+https://github.com/syntax-tree/mdast-util-definitions.git"},"bugs":{"url":"https://github.com/syntax-tree/mdast-util-definitions/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"files":["index.js"],"devDependencies":{"browserify":"^14.0.0","esmangle":"^1.0.0","nyc":"^11.0.0","remark":"^7.0.0","remark-cli":"^3.0.0","remark-preset-wooorm":"^3.0.0","tape":"^4.0.0","xo":"^0.18.2"},"scripts":{"build-md":"remark . --quiet --frail --output","build-bundle":"browserify index.js --no-builtins -s mdastUtilDefinitions > mdast-util-definitions.js","build-mangle":"esmangle mdast-util-definitions.js > mdast-util-definitions.min.js","build":"npm run build-md && npm run build-bundle && npm run build-mangle","lint":"xo","test-api":"node test.js","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run build && npm run lint && npm run test-coverage"},"xo":{"space":true,"esnext":false,"ignore":["mdast-util-definitions.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"53e8e8f01e98673212ee43639f408e5932f8c86f","homepage":"https://github.com/syntax-tree/mdast-util-definitions#readme","_id":"mdast-util-definitions@1.2.2","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"integrity":"sha512-9NloPSwaB9f1PKcGqaScfqRf6zKOEjTIXVIbPOmgWI/JKxznlgVXC5C+8qgl3AjYg2vJBRgLYfLICaNiac89iA==","shasum":"673f4377c3e23d3de7af7a4fe2214c0e221c5ac7","tarball":"http://registry-npm.ywwl.com/mdast-util-definitions/download/mdast-util-definitions-1.2.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAyS24+Gdijgu9kRK++FfPPPIEw5WKkqWm64z0/yjuqhAiB9g57lfI7humv+JxbhCGgsXywEZ+XQYK6jlwRVMZw07g=="}],"size":2613,"noattachment":false,"key":"/mdast-util-definitions/-/mdast-util-definitions-1.2.2.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mdast-util-definitions-1.2.2.tgz_1497635019994_0.8769929986447096"},"directories":{},"readme":"# mdast-util-definitions\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][] utility to find definitions by `identifier`.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`definitions(tree)`](#definitionstree)\n    *   [`GetDefinition`](#getdefinition)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package is a tiny utility that lets you find definitions.\n\n## When should I use this?\n\nThis utility can be useful because definitions can occur after the things that\nreference them.\nIt’s small and protects against prototype pollution.\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-definitions\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {definitions} from 'https://esm.sh/mdast-util-definitions@6'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {definitions} from 'https://esm.sh/mdast-util-definitions@6?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {definitions} from 'mdast-util-definitions'\nimport {fromMarkdown} from 'mdast-util-from-markdown'\n\nconst tree = fromMarkdown('[example]: https://example.com \"Example\"')\n\nconst definition = definitions(tree)\n\ndefinition('example')\n// => {type: 'definition', 'title': 'Example', …}\n\ndefinition('foo')\n// => undefined\n```\n\n## API\n\nThis package exports the identifier [`definitions`][api-definitions].\nThere is no default export.\n\n### `definitions(tree)`\n\nFind definitions in `tree`.\n\nUses CommonMark precedence, which means that earlier definitions are\npreferred over duplicate later definitions.\n\n###### Parameters\n\n*   `tree` ([`Node`][node])\n    — tree to check\n\n###### Returns\n\nGetter ([`GetDefinition`][api-getdefinition]).\n\n### `GetDefinition`\n\nGet a definition by identifier (TypeScript type).\n\n###### Parameters\n\n*   `identifier` (`string`, optional)\n    — identifier of definition\n\n###### Returns\n\nDefinition corresponding to `identifier` ([`Definition`][definition]) or\n`undefined`.\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type  [`GetDefinition`][api-getdefinition].\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,\n`mdast-util-definitions@^6`, compatible with Node.js 16.\n\n## Security\n\nUse of `mdast-util-definitions` does not involve **[hast][]** or user content so\nthere are no openings for [cross-site scripting (XSS)][xss] attacks.\nAdditionally, safe guards are in place to protect against prototype poisoning.\n\n## Related\n\n*   [`unist-util-index`](https://github.com/syntax-tree/unist-util-index)\n    — index property values or computed keys to nodes\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[build-badge]: https://github.com/syntax-tree/mdast-util-definitions/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/mdast-util-definitions/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-definitions.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/mdast-util-definitions\n\n[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-definitions.svg\n\n[downloads]: https://www.npmjs.com/package/mdast-util-definitions\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-definitions\n\n[size]: https://bundlejs.com/?q=mdast-util-definitions\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/syntax-tree/unist/discussions\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[health]: https://github.com/syntax-tree/.github\n\n[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md\n\n[support]: https://github.com/syntax-tree/.github/blob/main/support.md\n\n[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md\n\n[mdast]: https://github.com/syntax-tree/mdast\n\n[node]: https://github.com/syntax-tree/unist#node\n\n[definition]: https://github.com/syntax-tree/mdast#definition\n\n[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[hast]: https://github.com/syntax-tree/hast\n\n[api-definitions]: #definitionstree\n\n[api-getdefinition]: #getdefinition\n","publish_time":1497635020920,"_cnpm_publish_time":1497635020920,"dist-tags":{"latest":"6.0.0"}}