{"name":"hast-util-heading-rank","version":"1.0.1","description":"hast utility to get the rank (or depth, level) of headings","license":"MIT","keywords":["unist","hast","hast-util","util","utility","html","heading","rank","depth","level"],"repository":{"type":"git","url":"git+https://github.com/syntax-tree/hast-util-heading-rank.git"},"bugs":{"url":"https://github.com/syntax-tree/hast-util-heading-rank/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"}],"dependencies":{},"devDependencies":{"hastscript":"^5.0.0","nyc":"^15.0.0","prettier":"^1.0.0","remark-cli":"^7.0.0","remark-preset-wooorm":"^6.0.0","tape":"^4.0.0","xo":"^0.27.0"},"scripts":{"format":"remark . -qfo && prettier --write \"**/*.js\" && xo --fix","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"4db5e67da6757f4b355d2af4e47222eaba0c6317","homepage":"https://github.com/syntax-tree/hast-util-heading-rank#readme","_id":"hast-util-heading-rank@1.0.1","_nodeVersion":"13.9.0","_npmVersion":"6.13.7","dist":{"integrity":"sha512-P6Hq7RCky9syMevlrN90QWpqWDXCxwIVOfQR2rK6P4GpY4bqjKEuCzoWSRORZ7vz+VgRpLnXimh+mkwvVFjbyQ==","shasum":"28dfd8b0724cfb0da48308e2a794b1d9f24fd80d","tarball":"http://registry-npm.ywwl.com/hast-util-heading-rank/download/hast-util-heading-rank-1.0.1.tgz","fileCount":4,"unpackedSize":6148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeX5mSCRA9TVsSAnZWagAAslsQAIvrZ853f93HBTH+wZ3r\nVg/HYIt0AqERoHxigF3ZMyc44zJVhcOkYURjus1P0tpiGEzbgZAV0sCmjpuy\nOYAz4NXW35Cg3E/POXvWg7LR4lvfQoo2/RP0DPEzYUTQm38dRmmvI29FWma1\nWsplycRc7acP9Z2ATinX2kx0KC4iYOymIgFHeEpBcBcflpr7JPTOQPJTRQ2r\n8a1PfcSJDAMclTayIY7XTKhvM9j8aDj8HxpSuP66/yEtm444o7kAT31qiWuH\n6dBY6XUbUD2xAxO9EG6CLfayQEceOQnnOw23q/aP1niB0rXqlw80tPXWpHow\ntVbMTkdPkokL8rDtCGcA7rQectANRhys1BujxACLBpnZKRrRuvg7L+ZuNGtg\nC0vorCVtb+l5cjiycOmG6pnaElMAjMY/crmD1Bfbx+Ko0kirjPpCVV1NZEvS\nrkEDx/s4EKCB6JcKmJGA1P9bgGMAQ38czVcOarKsKZBoqtOQe08yWKKoQQu0\nXl6XyHScqcesvOpJgxBHpYQgDJYsZFaNK5alawhO3xHSZm61HU8xXTXEH6Er\nK0UJrDEwPpXo1lrevmApSkxhiq87hxqsNezReGVlN3cNJAtTI2hfDbmRv3E4\nOJCD1PossvVKn1dJJW/CQ4Yq0PG9Q2okqHbcmIrbsxaQs4815W9tv3OeNNIy\ndzsE\r\n=xwvB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCc2IL8f3/EcRM4QNmX7WUZtMolWWH8muHe9QnS9YMkywIgCOhNc/IkJ9P/3j1+eomCE3osVgdh9wrBjvlXz5El9b4="}],"size":2742,"noattachment":false,"key":"/hast-util-heading-rank/-/hast-util-heading-rank-1.0.1.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/hast-util-heading-rank_1.0.1_1583323538198_0.10246058214493226"},"_hasShrinkwrap":false,"readme":"# hast-util-heading-rank\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[hast][] utility to get the rank (also known as depth or level) of headings.\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    *   [`headingRank(node)`](#headingranknode)\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 utility that lets you get the rank (`1`, `6`) of heading\nelements (`h1`, `h6`).\n\n## When should I use this?\n\nThis utility is pretty niche, if you’re here you probably know what you’re\nlooking for!\n\nTo change heading ranks, use\n[`hast-util-shift-heading`][hast-util-shift-heading].\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install hast-util-heading-rank\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {headingRank} from 'https://esm.sh/hast-util-heading-rank@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {headingRank} from 'https://esm.sh/hast-util-heading-rank@3?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {h} from 'hastscript'\nimport {headingRank} from 'hast-util-heading-rank'\n\nheadingRank(h('p', 'Alpha')) //=> undefined\nheadingRank(h('h5', 'Alpha')) //=> 5\n```\n\n## API\n\nThis package exports the identifier [`headingRank`][api-heading-rank].\nThere is no default export.\n\n### `headingRank(node)`\n\nGet the rank (`1` to `6`) of headings (`h1` to `h6`).\n\n###### Parameters\n\n*   `node` ([`Node`][node])\n    — node to check\n\n###### Returns\n\nRank of the heading (`number`) or `undefined` if not a heading.\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\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`hast-util-heading-rank@^3`, compatible with Node.js 16.\n\n## Security\n\n`hast-util-heading-rank` does not mutate.\nThere are no openings for [cross-site scripting (XSS)][xss] attacks.\n\n## Related\n\n*   [`hast-util-heading`](https://github.com/syntax-tree/hast-util-heading)\n    — check if a node is heading content\n*   [`hast-util-shift-heading`](https://github.com/syntax-tree/hast-util-heading)\n    — change heading rank\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<!-- Definition -->\n\n[build-badge]: https://github.com/syntax-tree/hast-util-heading-rank/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/hast-util-heading-rank/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/hast-util-heading-rank.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/hast-util-heading-rank\n\n[downloads-badge]: https://img.shields.io/npm/dm/hast-util-heading-rank.svg\n\n[downloads]: https://www.npmjs.com/package/hast-util-heading-rank\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=hast-util-heading-rank\n\n[size]: https://bundlejs.com/?q=hast-util-heading-rank\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[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[license]: license\n\n[author]: https://wooorm.com\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[hast]: https://github.com/syntax-tree/hast\n\n[node]: https://github.com/syntax-tree/hast#nodes\n\n[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[hast-util-shift-heading]: https://github.com/syntax-tree/hast-util-shift-heading\n\n[api-heading-rank]: #headingranknode\n","publish_time":1583323538301,"_cnpm_publish_time":1583323538301,"dist-tags":{"latest":"3.0.0"}}