{"name":"mdast-util-definitions","version":"4.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":{"unist-util-visit":"^2.0.0"},"devDependencies":{"@types/mdast":"^3.0.0","browserify":"^16.0.0","dtslint":"^4.0.0","nyc":"^15.0.0","prettier":"^2.0.0","remark":"^12.0.0","remark-cli":"^8.0.0","remark-preset-wooorm":"^7.0.0","tape":"^5.0.0","tinyify":"^3.0.0","xo":"^0.33.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":"8290999ea40c4c56922e8bd281daa56eb70a82e8","homepage":"https://github.com/syntax-tree/mdast-util-definitions#readme","_id":"mdast-util-definitions@4.0.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-k8AJ6aNnUkB7IE+5azR9h81O5EQ/cTDXtWdMq9Kk5KcEW/8ritU5CeLg/9HhOC++nALHBlaogJ5jz0Ybk3kPMQ==","shasum":"c5c1a84db799173b4dcf7643cda999e440c24db2","tarball":"http://registry-npm.ywwl.com/mdast-util-definitions/download/mdast-util-definitions-4.0.0.tgz","fileCount":8,"unpackedSize":9191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeE94CRA9TVsSAnZWagAAsocQAKPvMGonLlQAU8r8paf+\n7DnNsB7DT/uZIxx1LQ/PNdX54bAdpl59PWOF2hARKlzK2cNBN/JlwmLdySuU\nkunM7ohxnawjuFTLomObbk+qlFpjZ3JuVLv3ThVzSAZExl7xKKjet48GRNml\niwbrSLMTRAxvGC01ZRSuWFb8FMpnSKVnBmcv4UyKoUJQCCMGle7DNHWbz5Hd\n8kiRijQE4Bl/hYjHe7b4OpszrlzEDRUBbIfkOqqwgOWkzv8KvtrMX3ab+ool\nvettFWW9yOIuQCXPl8vXTrSNLsgVohExTCZ87BkXmJzUqnIz7alQAA+cBP5f\nNAEnwQVCi0RJ36UvsiAH0hw8RZ3WfC78R/UHb06fPQxJDlex2WPA4ObxQjoJ\n0O5YV5z2B6ETYGqk85XlUWU4p29ufSiU4IJksMOdapZ8eY8aje/P0pbUGMiB\nAO3xgum/Gj90qJXT4Kp6/uzcp1tmZZYe1F+5ECcxFyz1viq7xRU2Bio/NT8B\nLoNPRyICgsPhdk8ok659RKugrzvxEG+DBu5pp4yQ6mQLgmh1gNs/2tNBXf2O\nF+hypyozJwg6uhtK3TzGlTK6z0DKxGciJMUn4nBusKOBAiqa6odo4JfPAwuR\nr8VpvMW211K91/6AY5XnHs6RlTVM4qlpWPVgttSSgC/t1nVyE+pQpB1Id39o\n5upf\r\n=PrW2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHxDcaF3YBlRkvbFB+KfPuHZO7VQhtmI9vRQwO+F6TS5AiBqzDDQEhm2xtYhWMEZoyrR7hExLeMt0OPitgN9lOejkQ=="}],"size":3765,"noattachment":false,"key":"/mdast-util-definitions/-/mdast-util-definitions-4.0.0.tgz"},"maintainers":[{"name":"kmck","email":"keith@mcknig.ht"},{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mdast-util-definitions_4.0.0_1601720183914_0.23827953208102226"},"_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":1601720184029,"_cnpm_publish_time":1601720184029,"dist-tags":{"latest":"6.0.0"}}