{"_id":"@cjser/micromark-util-character","name":"@cjser/micromark-util-character","dist-tags":{"latest":"2.1.1-cjser.2"},"versions":{"2.1.1-cjser.2":{"name":"@cjser/micromark-util-character","version":"2.1.1-cjser.2","description":"micromark utility to handle character codes","license":"MIT","keywords":["micromark","util","utility","character"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"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":{"require":"./dist-cjser/index.cjs","development":"./dev/index.js","default":"./index.js"},"dependencies":{"@cjser/micromark-util-symbol":"2.0.1-cjser.2","@cjser/micromark-util-types":"2.0.2-cjser.2"},"scripts":{"build":"micromark-build"},"xo":{"envs":["shared-node-browser"],"prettier":true,"rules":{"unicorn/prefer-code-point":"off"}},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"2.1.1","cjserVersion":2,"original":{"name":"micromark-util-character","version":"2.1.1","exports":{"development":"./dev/index.js","default":"./index.js"},"repository":"https://github.com/micromark/micromark/tree/main/packages/micromark-util-character","dependencies":{"micromark-util-symbol":"^2.0.0","micromark-util-types":"^2.0.0"},"files":["dev/","lib/","index.d.ts.map","index.d.ts","index.js"],"scripts":{"build":"micromark-build"}}},"gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_id":"@cjser/micromark-util-character@2.1.1-cjser.2","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-0T5seVeDM8zeMA1PKSbg2MKeaZ6knZ+Bz0Lfct786EYcNMqHUQt7iYMp45yUnUaMYiSjGjdtJZdmrWM6U4wYRw==","shasum":"d90c4270b57efd711d0d0ffe01ceee304a9184b4","tarball":"https://registry.npmjs.org/@cjser/micromark-util-character/-/micromark-util-character-2.1.1-cjser.2.tgz","fileCount":10,"unpackedSize":46386,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDr3u2TtKwn2ZPxPjHXnYKiEWFfYzPwzMie8/o7id/qHQIhAIPFt+DuBFH1qN8pZOHYuL05QRD+9dDBdH/Vn3GCduDU"}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/micromark-util-character_2.1.1-cjser.2_1778864999203_0.07329827864184768"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-15T17:09:59.084Z","2.1.1-cjser.2":"2026-05-15T17:09:59.380Z","modified":"2026-05-15T17:09:59.630Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"micromark utility to handle character codes","keywords":["micromark","util","utility","character"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"license":"MIT","readme":"# micromark-util-character\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 handle [character codes][code].\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  * [`asciiAlpha(code)`](#asciialphacode)\n  * [`asciiAlphanumeric(code)`](#asciialphanumericcode)\n  * [`asciiAtext(code)`](#asciiatextcode)\n  * [`asciiControl(code)`](#asciicontrolcode)\n  * [`asciiDigit(code)`](#asciidigitcode)\n  * [`asciiHexDigit(code)`](#asciihexdigitcode)\n  * [`asciiPunctuation(code)`](#asciipunctuationcode)\n  * [`markdownLineEnding(code)`](#markdownlineendingcode)\n  * [`markdownLineEndingOrSpace(code)`](#markdownlineendingorspacecode)\n  * [`markdownSpace(code)`](#markdownspacecode)\n  * [`unicodePunctuation(code)`](#unicodepunctuationcode)\n  * [`unicodeWhitespace(code)`](#unicodewhitespacecode)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package exposes algorithms to check whether characters match groups.\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-character\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport * as character from 'https://esm.sh/micromark-util-character@1'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import * as character from 'https://esm.sh/micromark-util-character@1?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {asciiAlpha} from 'micromark-util-character'\n\nconsole.log(asciiAlpha(64)) // false\nconsole.log(asciiAlpha(65)) // true\n```\n\n## API\n\nThis module exports the identifiers\n[`asciiAlpha`][api-ascii-alpha],\n[`asciiAlphanumeric`][api-ascii-alphanumeric],\n[`asciiAtext`][api-ascii-atext],\n[`asciiControl`][api-ascii-control],\n[`asciiDigit`][api-ascii-digit],\n[`asciiHexDigit`][api-ascii-hex-digit],\n[`asciiPunctuation`][api-ascii-punctuation],\n[`markdownLineEnding`][api-markdown-line-ending],\n[`markdownLineEndingOrSpace`][api-markdown-line-ending-or-space],\n[`markdownSpace`][api-markdown-space],\n[`unicodePunctuation`][api-unicode-punctuation],\n[`unicodeWhitespace`][api-unicode-whitespace].\nThere is no default export.\n\n### `asciiAlpha(code)`\n\nCheck whether the [character code][code] represents an ASCII alpha (`a` through\n`z`, case insensitive).\n\nAn **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.\n\nAn **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)\nto U+005A (`Z`).\n\nAn **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)\nto U+007A (`z`).\n\n###### Parameters\n\n* `code` (`Code`)\n  — code\n\n###### Returns\n\nWhether it matches (`boolean`).\n\n### `asciiAlphanumeric(code)`\n\nCheck whether the [character code][code] represents an ASCII alphanumeric (`a`\nthrough `z`, case insensitive, or `0` through `9`).\n\nAn **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha\n(see `asciiAlpha`).\n\n###### Parameters\n\n* `code` (`Code`)\n  — code\n\n###### Returns\n\nWhether it matches (`boolean`).\n\n### `asciiAtext(code)`\n\nCheck whether the [character code][code] represents an ASCII atext.\n\natext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in\nthe inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),\nU+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F\nSLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E\nCARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE\n(`{`) to U+007E TILDE (`~`) (**\\[RFC5322]**).\n\nSee **\\[RFC5322]**:\\\n[Internet Message Format](https://tools.ietf.org/html/rfc5322).\\\nP. Resnick.\\\nIETF.\n\n###### Parameters\n\n* `code` (`Code`)\n  — code\n\n###### Returns\n\nWhether it matches (`boolean`).\n\n### `asciiControl(code)`\n\nCheck whether a [character code][code] is an ASCII control character.\n\nAn **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)\nto U+001F (US), or U+007F (DEL).\n\n###### Parameters\n\n* `code` (`Code`)\n  — code\n\n###### Returns\n\nWhether it matches (`boolean`).\n\n### `asciiDigit(code)`\n\nCheck whether the [character code][code] represents an ASCII digit (`0` through\n`9`).\n\nAn **ASCII digit** is a character in the inclusive range U+0030 (`0`) to\nU+0039 (`9`).\n\n###### Parameters\n\n* `code` (`Code`)\n  — code\n\n###### Returns\n\nWhether it matches (`boolean`).\n\n### `asciiHexDigit(code)`\n\nCheck whether the [character code][code] represents an ASCII hex digit (`a`\nthrough `f`, case insensitive, or `0` through `9`).\n\nAn **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex\ndigit, or an ASCII lower hex digit.\n\nAn **ASCII upper hex digit** is a character in the inclusive range U+0041\n(`A`) to U+0046 (`F`).\n\nAn **ASCII lower hex digit** is a character in the inclusive range U+0061\n(`a`) to U+0066 (`f`).\n\n###### Parameters\n\n* `code` (`Code`)\n  — code\n\n###### Returns\n\nWhether it matches (`boolean`).\n\n### `asciiPunctuation(code)`\n\nCheck whether the [character code][code] represents ASCII punctuation.\n\nAn **ASCII punctuation** is a character in the inclusive ranges U+0021\nEXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT\nSIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT\n(`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).\n\n###### Parameters\n\n* `code` (`Code`)\n  — code\n\n###### Returns\n\nWhether it matches (`boolean`).\n\n### `markdownLineEnding(code)`\n\nCheck whether a [character code][code] is a markdown line ending.\n\nA **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN\nLINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).\n\nIn micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE\nRETURN (CR) are replaced by these virtual characters depending on whether\nthey occurred together.\n\n###### Parameters\n\n* `code` (`Code`)\n  — code\n\n###### Returns\n\nWhether it matches (`boolean`).\n\n### `markdownLineEndingOrSpace(code)`\n\nCheck whether a [character code][code] is a markdown line ending (see\n`markdownLineEnding`) or markdown space (see `markdownSpace`).\n\n###### Parameters\n\n* `code` (`Code`)\n  — code\n\n###### Returns\n\nWhether it matches (`boolean`).\n\n### `markdownSpace(code)`\n\nCheck whether a [character code][code] is a markdown space.\n\nA **markdown space** is the concrete character U+0020 SPACE (SP) and the\nvirtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).\n\nIn micromark, the actual character U+0009 CHARACTER TABULATION (HT) is\nreplaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL\nSPACE (VS) characters, depending on the column at which the tab occurred.\n\n###### Parameters\n\n* `code` (`Code`)\n  — code\n\n###### Returns\n\nWhether it matches (`boolean`).\n\n### `unicodePunctuation(code)`\n\nCheck whether the [character code][code] represents Unicode punctuation.\n\nA **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,\nConnector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`\n(Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`\n(Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII\npunctuation (see `asciiPunctuation`) (**\\[UNICODE]**).\n\nSee **\\[UNICODE]**:\\\n[The Unicode Standard](https://www.unicode.org/versions/).\\\nUnicode Consortium.\n\n###### Parameters\n\n* `code` (`Code`)\n  — code\n\n###### Returns\n\nWhether it matches (`boolean`).\n\n### `unicodeWhitespace(code)`\n\nCheck whether the [character code][code] represents Unicode whitespace.\n\nNote that this does handle micromark specific markdown whitespace characters.\nSee `markdownLineEndingOrSpace` to check that.\n\nA **Unicode whitespace** is a character in the Unicode `Zs` (Separator,\nSpace) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),\nU+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\\[UNICODE]**).\n\nSee **\\[UNICODE]**:\\\n[The Unicode Standard](https://www.unicode.org/versions/).\\\nUnicode Consortium.\n\n###### Parameters\n\n* `code` (`Code`)\n  — code\n\n###### Returns\n\nWhether it matches (`boolean`).\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-character@2`, compatible with Node.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-character.svg\n\n[downloads]: https://www.npmjs.com/package/micromark-util-character\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-character\n\n[bundle-size]: https://bundlejs.com/?q=micromark-util-character\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[code]: https://github.com/micromark/micromark#preprocess\n\n[api-ascii-alpha]: #asciialphacode\n\n[api-ascii-alphanumeric]: #asciialphanumericcode\n\n[api-ascii-atext]: #asciiatextcode\n\n[api-ascii-control]: #asciicontrolcode\n\n[api-ascii-digit]: #asciidigitcode\n\n[api-ascii-hex-digit]: #asciihexdigitcode\n\n[api-ascii-punctuation]: #asciipunctuationcode\n\n[api-markdown-line-ending]: #markdownlineendingcode\n\n[api-markdown-line-ending-or-space]: #markdownlineendingorspacecode\n\n[api-markdown-space]: #markdownspacecode\n\n[api-unicode-punctuation]: #unicodepunctuationcode\n\n[api-unicode-whitespace]: #unicodewhitespacecode\n\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/micromark/micromark/tree/main/packages/micromark-util-character\n","readmeFilename":"readme.md","_rev":"1-8081f01f3c198a885cc659eaddbcccbd"}