{"name":"mdast-util-definitions","version":"3.0.0","description":"mdast utility to find definition nodes in a tree","license":"MIT","keywords":["unist","mdast","mdast-util","util","utility","markdown","tree","node","definition","find","cache"],"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"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"types":"types/index.d.ts","dependencies":{"@types/mdast":"^3.0.0","unist-util-visit":"^2.0.0"},"devDependencies":{"browserify":"^16.0.0","dtslint":"^3.0.0","nyc":"^15.0.0","prettier":"^2.0.5","remark":"^12.0.0","remark-cli":"^8.0.0","remark-preset-wooorm":"^7.0.0","tape":"^5.0.0","tinyify":"^2.0.0","xo":"^0.30.0"},"scripts":{"format":"remark . -qfo && prettier --write . && xo --fix --ignore types","build-bundle":"browserify . -s mdastUtilDefinitions > mdast-util-definitions.js","build-mangle":"browserify . -s mdastUtilDefinitions -p tinyify > mdast-util-definitions.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test-types":"dtslint types","test":"npm run format && npm run build && npm run test-coverage && npm run test-types"},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"ignore":["types","mdast-util-definitions.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"9d85ddc5e23a29e162f5851a456b4e14ff515147","homepage":"https://github.com/syntax-tree/mdast-util-definitions#readme","_id":"mdast-util-definitions@3.0.0","_nodeVersion":"13.10.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Z4olVIQmv9fp6iJbi/wbEijCnmof8lrwviJMHmMj/hGIGtPWT1Il96bUbKpF8sbMJX2gAiNwhsC7BAQZUbKNsg==","shasum":"4fa0764409cc45b6a450bbd3647b0da9d318ae79","tarball":"http://registry-npm.ywwl.com/mdast-util-definitions/download/mdast-util-definitions-3.0.0.tgz","fileCount":8,"unpackedSize":9639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJep+P4CRA9TVsSAnZWagAA09AP/2K+5bz7tv8YzGE9KIBx\nfEcUyRv1RR9eNlXToltsW57q+WML5/WMEtd0gJ3yfVcvEDfSi1amNBnUFDH9\ndIP14rXxNbBM0bvAtEiq0NxlhJP2P2xN1PDNiWKR2U9g8OjEZ4BhZAgG5ovo\nyFTfeqMrycu72Ss2oGIkpP+tkhr5Ffhc+5C0hWwEqXJVp/fsPpIcr0dIjEPU\nJy8raUp5i1RB79fhKj3pc8xQ/lhIQgjCwox+I6foK0eHGqBFqMdfrxiFeaE4\n3whpyMWeXOUnsMXAhWZL/GOs0Tltrzt52IB4Int/mBb1TWiCZmje8+RGi3h3\nKUunFBCvL2JpWSNk6IuklXim7OItCQSb3+ARYcsnvzh4VwoYKLb+fvl+dEvG\nH90F2mjfqMohD30mVLfZV6FqO1FHcJxKXBhAIi2fWbsnfhwJM5LcuQGI3tDp\nSn0xglUDIlzBJAj3QsCB7M7tSgZybP0y5PQwH1QCptYVX24L9gTvH8XVUFcS\nZbV6UrkvBfRqBkJM4/lbJVrBFsCwXoJ1uDP1qTih+x3TlIM57/wscRqsh3wg\nSIWwhHasNLENljS9uWvRZj+0/siBeDVeQy1cCEBKl01TeyIHnGzgU87smeoo\nEtBogrS2wv1k/7PASkxueVZIlsdwpJvoQ/xdCo3kPbMnC2JGWm6y98yHNclb\nqRFU\r\n=YDgN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB/mkwMbkV67dL4TWBst0Re7imf2kzky6+fAbXtmAZH8AiEApiDeMjE04wrF7k71k/VV4n+uMYxfyJZyez0qVzVopDQ="}],"size":3891,"noattachment":false,"key":"/mdast-util-definitions/-/mdast-util-definitions-3.0.0.tgz"},"maintainers":[{"email":"keith@mcknig.ht","name":"kmck"},{"email":"tituswormer@gmail.com","name":"wooorm"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mdast-util-definitions_3.0.0_1588061176080_0.7944241212903829"},"_hasShrinkwrap":false,"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":1588061176207,"_cnpm_publish_time":1588061176207,"dist-tags":{"latest":"6.0.0"}}