{"_id":"micromark-util-decode-numeric-character-reference","_rev":"3759808","name":"micromark-util-decode-numeric-character-reference","description":"micromark utility to decode numeric character references","dist-tags":{"latest":"2.0.2","next":"1.0.0-beta.1"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"time":{"modified":"2025-04-22T08:05:04.000Z","created":"2021-06-20T12:13:18.702Z","2.0.2":"2024-11-12T11:17:27.210Z","2.0.1":"2023-10-27T08:59:10.042Z","2.0.0":"2023-06-21T16:40:57.646Z","1.1.0":"2023-05-30T12:26:51.832Z","1.0.0":"2021-06-22T19:04:07.792Z","1.0.0-beta.1":"2021-06-20T12:13:18.702Z"},"users":{},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"versions":{"2.0.2":{"name":"micromark-util-decode-numeric-character-reference","version":"2.0.2","description":"micromark utility to decode numeric character references","license":"MIT","keywords":["micromark","util","utility","decode","numeric","number","character","reference"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"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"}],"sideEffects":false,"type":"module","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-symbol":"^2.0.0"},"scripts":{"build":"micromark-build"},"xo":{"envs":["shared-node-browser"],"prettier":true,"rules":{"unicorn/prefer-code-point":"off"}},"_id":"micromark-util-decode-numeric-character-reference@2.0.2","gitHead":"bcb6195e777f4109ddd2a20bbe0c24ec6fa369e9","types":"./index.d.ts","homepage":"https://github.com/micromark/micromark/tree/main#readme","_nodeVersion":"23.1.0","_npmVersion":"10.9.0","dist":{"shasum":"fcf15b660979388e6f118cdb6bf7d79d73d26fe5","size":3833,"noattachment":false,"key":"/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/micromark-util-decode-numeric-character-reference/download/micromark-util-decode-numeric-character-reference-2.0.2.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-util-decode-numeric-character-reference_2.0.2_1731410247030_0.2746276355899502"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-11-12T11:17:27.210Z","publish_time":1731410247210,"_source_registry_name":"default","_cnpm_publish_time":1731410247210},"2.0.1":{"name":"micromark-util-decode-numeric-character-reference","version":"2.0.1","description":"micromark utility to decode numeric character references","license":"MIT","keywords":["micromark","util","utility","decode","numeric","number","character","reference"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"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"}],"sideEffects":false,"type":"module","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-symbol":"^2.0.0"},"scripts":{"build":"micromark-build"},"xo":{"envs":["shared-node-browser"],"prettier":true,"rules":{"unicorn/prefer-code-point":"off"}},"_id":"micromark-util-decode-numeric-character-reference@2.0.1","gitHead":"929275e2ccdfc8fd54adb1e1da611020600cc951","types":"./index.d.ts","homepage":"https://github.com/micromark/micromark/tree/main#readme","_nodeVersion":"21.0.0","_npmVersion":"10.2.0","dist":{"shasum":"2698bbb38f2a9ba6310e359f99fcb2b35a0d2bd5","size":2980,"noattachment":false,"key":"/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/micromark-util-decode-numeric-character-reference/download/micromark-util-decode-numeric-character-reference-2.0.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-util-decode-numeric-character-reference_2.0.1_1698397149843_0.5708745403569153"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-27T08:59:10.042Z","publish_time":1698397150042,"_source_registry_name":"default","_cnpm_publish_time":1698397150042},"2.0.0":{"name":"micromark-util-decode-numeric-character-reference","version":"2.0.0","description":"micromark utility to decode numeric character references","license":"MIT","keywords":["micromark","util","utility","decode","numeric","number","character","reference"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"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"}],"sideEffects":false,"type":"module","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-symbol":"^2.0.0"},"scripts":{"build":"micromark-build"},"xo":false,"types":"./index.d.ts","gitHead":"eb2bafea3387ea7740158b85561acb769473f623","homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-util-decode-numeric-character-reference@2.0.0","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"shasum":"a798808d02cc74113e2c939fc95363096ade7f1d","size":2880,"noattachment":false,"key":"/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/micromark-util-decode-numeric-character-reference/download/micromark-util-decode-numeric-character-reference-2.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-util-decode-numeric-character-reference_2.0.0_1687365657469_0.39135386536807215"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-06-21T16:40:57.646Z","publish_time":1687365657646,"_source_registry_name":"default","_cnpm_publish_time":1687365657646},"1.1.0":{"name":"micromark-util-decode-numeric-character-reference","version":"1.1.0","description":"micromark utility to decode numeric character references","license":"MIT","keywords":["micromark","util","utility","decode","numeric","number","character","reference"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"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"}],"sideEffects":false,"type":"module","main":"index.js","types":"dev/index.d.ts","exports":{"types":"./dev/index.d.ts","development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-symbol":"^1.0.0"},"scripts":{"build":"micromark-build"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"94b7679646bc0221899bba034f52f4abb3700f81","homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-util-decode-numeric-character-reference@1.1.0","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"shasum":"b1e6e17009b1f20bc652a521309c5f22c85eb1c6","size":2920,"noattachment":false,"key":"/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/micromark-util-decode-numeric-character-reference/download/micromark-util-decode-numeric-character-reference-1.1.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-util-decode-numeric-character-reference_1.1.0_1685449611649_0.5249540427899653"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-30T12:26:51.832Z","publish_time":1685449611832,"_source_registry_name":"default","_cnpm_publish_time":1685449611832},"1.0.0":{"name":"micromark-util-decode-numeric-character-reference","version":"1.0.0","description":"micromark utility to decode numeric character references","license":"MIT","keywords":["micromark","util","utility","decode","numeric","number","character","reference"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"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"}],"sideEffects":false,"type":"module","main":"index.js","types":"dev/index.d.ts","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-symbol":"^1.0.0"},"scripts":{"build":"rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-util-decode-numeric-character-reference@1.0.0","_nodeVersion":"16.2.0","_npmVersion":"7.18.1","dist":{"shasum":"dcc85f13b5bd93ff8d2868c3dba28039d490b946","size":2365,"noattachment":false,"key":"/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/micromark-util-decode-numeric-character-reference/download/micromark-util-decode-numeric-character-reference-1.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-util-decode-numeric-character-reference_1.0.0_1624388647458_0.38278795698855994"},"_hasShrinkwrap":false,"publish_time":1624388647792,"_cnpm_publish_time":1624388647792},"1.0.0-beta.1":{"name":"micromark-util-decode-numeric-character-reference","version":"1.0.0-beta.1","description":"micromark utility to decode numeric character references","license":"MIT","keywords":["micromark","util","utility","decode","numeric","number","character","reference"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"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"}],"sideEffects":false,"type":"module","main":"index.js","types":"dev/index.d.ts","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-symbol":"^1.0.0-beta.1"},"scripts":{"build":"rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-util-decode-numeric-character-reference@1.0.0-beta.1","_nodeVersion":"16.2.0","_npmVersion":"7.18.1","dist":{"shasum":"1d100502608ef6f7e2366e69a2fbee95647bfc80","size":2369,"noattachment":false,"key":"/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.0.0-beta.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/micromark-util-decode-numeric-character-reference/download/micromark-util-decode-numeric-character-reference-1.0.0-beta.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-util-decode-numeric-character-reference_1.0.0-beta.1_1624191198586_0.8325799731114902"},"_hasShrinkwrap":false,"publish_time":1624191198702,"_cnpm_publish_time":1624191198702}},"readme":"# micromark-util-decode-numeric-character-reference\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][bundle-size-badge]][bundle-size]\n[![Sponsors][sponsors-badge]][opencollective]\n[![Backers][backers-badge]][opencollective]\n[![Chat][chat-badge]][chat]\n\n[micromark][] utility to decode numeric character references.\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  * [`decodeNumericCharacterReference(value, base)`](#decodenumericcharacterreferencevalue-base)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package exposes an algorithm to decode numeric character references.\n\n## When should I use this?\n\nThis package might be useful when you are making your own micromark extensions.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install micromark-util-decode-numeric-character-reference\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {decodeNumericCharacterReference} from 'https://esm.sh/micromark-util-decode-numeric-character-reference@1'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {decodeNumericCharacterReference} from 'https://esm.sh/micromark-util-decode-numeric-character-reference@1?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'\n\ndecodeNumericCharacterReference('41', 16) // 'A'\ndecodeNumericCharacterReference('65', 10) // 'A'\ndecodeNumericCharacterReference('A', 16) // '\\n'\ndecodeNumericCharacterReference('7F', 16) // '�' - Control\ndecodeNumericCharacterReference('110000', 16) // '�' - Out of range\n```\n\n## API\n\nThis module exports the identifier:\n[`decodeNumericCharacterReference`][api-decode-numeric-character-reference].\nThere is no default export.\n\n### `decodeNumericCharacterReference(value, base)`\n\nTurn the number (in string form as either hexa- or plain decimal) coming from\na numeric character reference into a character.\n\nSort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes\nnon-characters and control characters safe.\n\n###### Parameters\n\n* `value` (`string`)\n  — value to decode\n* `base` (`number`, probably `10` or `16`)\n  — numeric base\n\n###### Returns\n\nCharacter (`string`).\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`micromark-util-decode-numeric-character-reference@2`, compatible with\nNode.js 16.\nThis package works with `micromark@3`.\n\n## Security\n\nThis package is safe.\nSee [`security.md`][securitymd] in [`micromark/.github`][health] for how to\nsubmit a security report.\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`micromark/.github`][health] for ways\nto 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, organisation, 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/micromark/micromark/workflows/main/badge.svg\n\n[build]: https://github.com/micromark/micromark/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg\n\n[coverage]: https://codecov.io/github/micromark/micromark\n\n[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-normalize-identifier.svg\n\n[downloads]: https://www.npmjs.com/package/micromark-util-normalize-identifier\n\n[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-normalize-identifier\n\n[bundle-size]: https://bundlejs.com/?q=micromark-util-normalize-identifier\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[opencollective]: https://opencollective.com/unified\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[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/micromark/micromark/discussions\n\n[license]: https://github.com/micromark/micromark/blob/main/license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/micromark/.github\n\n[securitymd]: https://github.com/micromark/.github/blob/main/security.md\n\n[contributing]: https://github.com/micromark/.github/blob/main/contributing.md\n\n[support]: https://github.com/micromark/.github/blob/main/support.md\n\n[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md\n\n[typescript]: https://www.typescriptlang.org\n\n[micromark]: https://github.com/micromark/micromark\n\n[api-decode-numeric-character-reference]: #decodenumericcharacterreferencevalue-base\n","_attachments":{},"homepage":"https://github.com/micromark/micromark/tree/main#readme","bugs":{"url":"https://github.com/micromark/micromark/issues"},"license":"MIT"}