Gathering detailed insights and metrics for micromark-util-character
Gathering detailed insights and metrics for micromark-util-character
Gathering detailed insights and metrics for micromark-util-character
Gathering detailed insights and metrics for micromark-util-character
micromark-util-classify-character
micromark utility to classify whether a character is whitespace or punctuation
micromark-util-decode-numeric-character-reference
micromark utility to decode numeric character references
micromark-util-decode-string
micromark utility to decode markdown strings
small, safe, and great commonmark (optionally gfm, mdx) compliant markdown parser
npm install micromark-util-character
Typescript
Module System
Node Version
NPM Version
99.7
Supply Chain
99.5
Quality
76.6
Maintenance
100
Vulnerability
100
License
4.0.2
Updated on Feb 27, 2025
micromark-util-types@2.0.2
Updated on Feb 27, 2025
micromark-core-commonmark@2.0.3
Updated on Feb 27, 2025
micromark-util-subtokenize@2.1.0
Updated on Feb 27, 2025
micromark-util-subtokenize@2.0.3
Updated on Nov 19, 2024
4.0.1
Updated on Nov 12, 2024
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2,006 Stars
656 Commits
73 Forks
13 Watchers
2 Branches
29 Contributors
Updated on Jul 11, 2025
Latest Version
2.1.1
Package Id
micromark-util-character@2.1.1
Unpacked Size
41.43 kB
Size
6.21 kB
File Count
9
NPM Version
10.9.0
Node Version
23.1.0
Published on
Nov 12, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
micromark utility to handle character codes.
This package exposes algorithms to check whether characters match groups.
This package might be useful when you are making your own micromark extensions.
This package is ESM only. In Node.js (version 16+), install with npm:
1npm install micromark-util-character
In Deno with esm.sh
:
1import * as character from 'https://esm.sh/micromark-util-character@1'
In browsers with esm.sh
:
1<script type="module"> 2 import * as character from 'https://esm.sh/micromark-util-character@1?bundle' 3</script>
1import {asciiAlpha} from 'micromark-util-character'
2
3console.log(asciiAlpha(64)) // false
4console.log(asciiAlpha(65)) // true
This module exports the identifiers
asciiAlpha
,
asciiAlphanumeric
,
asciiAtext
,
asciiControl
,
asciiDigit
,
asciiHexDigit
,
asciiPunctuation
,
markdownLineEnding
,
markdownLineEndingOrSpace
,
markdownSpace
,
unicodePunctuation
,
unicodeWhitespace
.
There is no default export.
asciiAlpha(code)
Check whether the character code represents an ASCII alpha (a
through
z
, case insensitive).
An ASCII alpha is an ASCII upper alpha or ASCII lower alpha.
An ASCII upper alpha is a character in the inclusive range U+0041 (A
)
to U+005A (Z
).
An ASCII lower alpha is a character in the inclusive range U+0061 (a
)
to U+007A (z
).
code
(Code
)
— codeWhether it matches (boolean
).
asciiAlphanumeric(code)
Check whether the character code represents an ASCII alphanumeric (a
through z
, case insensitive, or 0
through 9
).
An ASCII alphanumeric is an ASCII digit (see asciiDigit
) or ASCII alpha
(see asciiAlpha
).
code
(Code
)
— codeWhether it matches (boolean
).
asciiAtext(code)
Check whether the character code represents an ASCII atext.
atext is an ASCII alphanumeric (see asciiAlphanumeric
), or a character in
the inclusive ranges U+0023 NUMBER SIGN (#
) to U+0027 APOSTROPHE ('
),
U+002A ASTERISK (*
), U+002B PLUS SIGN (+
), U+002D DASH (-
), U+002F
SLASH (/
), U+003D EQUALS TO (=
), U+003F QUESTION MARK (?
), U+005E
CARET (^
) to U+0060 GRAVE ACCENT (`
), or U+007B LEFT CURLY BRACE
({
) to U+007E TILDE (~
) ([RFC5322]).
See [RFC5322]:
Internet Message Format.
P. Resnick.
IETF.
code
(Code
)
— codeWhether it matches (boolean
).
asciiControl(code)
Check whether a character code is an ASCII control character.
An ASCII control is a character in the inclusive range U+0000 NULL (NUL) to U+001F (US), or U+007F (DEL).
code
(Code
)
— codeWhether it matches (boolean
).
asciiDigit(code)
Check whether the character code represents an ASCII digit (0
through
9
).
An ASCII digit is a character in the inclusive range U+0030 (0
) to
U+0039 (9
).
code
(Code
)
— codeWhether it matches (boolean
).
asciiHexDigit(code)
Check whether the character code represents an ASCII hex digit (a
through f
, case insensitive, or 0
through 9
).
An ASCII hex digit is an ASCII digit (see asciiDigit
), ASCII upper hex
digit, or an ASCII lower hex digit.
An ASCII upper hex digit is a character in the inclusive range U+0041
(A
) to U+0046 (F
).
An ASCII lower hex digit is a character in the inclusive range U+0061
(a
) to U+0066 (f
).
code
(Code
)
— codeWhether it matches (boolean
).
asciiPunctuation(code)
Check whether the character code represents ASCII punctuation.
An ASCII punctuation is a character in the inclusive ranges U+0021
EXCLAMATION MARK (!
) to U+002F SLASH (/
), U+003A COLON (:
) to U+0040 AT
SIGN (@
), U+005B LEFT SQUARE BRACKET ([
) to U+0060 GRAVE ACCENT
(`
), or U+007B LEFT CURLY BRACE ({
) to U+007E TILDE (~
).
code
(Code
)
— codeWhether it matches (boolean
).
markdownLineEnding(code)
Check whether a character code is a markdown line ending.
A markdown line ending is the virtual characters M-0003 CARRIAGE RETURN LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE RETURN (CR) are replaced by these virtual characters depending on whether they occurred together.
code
(Code
)
— codeWhether it matches (boolean
).
markdownLineEndingOrSpace(code)
Check whether a character code is a markdown line ending (see
markdownLineEnding
) or markdown space (see markdownSpace
).
code
(Code
)
— codeWhether it matches (boolean
).
markdownSpace(code)
Check whether a character code is a markdown space.
A markdown space is the concrete character U+0020 SPACE (SP) and the virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL SPACE (VS) characters, depending on the column at which the tab occurred.
code
(Code
)
— codeWhether it matches (boolean
).
unicodePunctuation(code)
Check whether the character code represents Unicode punctuation.
A Unicode punctuation is a character in the Unicode Pc
(Punctuation,
Connector), Pd
(Punctuation, Dash), Pe
(Punctuation, Close), Pf
(Punctuation, Final quote), Pi
(Punctuation, Initial quote), Po
(Punctuation, Other), or Ps
(Punctuation, Open) categories, or an ASCII
punctuation (see asciiPunctuation
) ([UNICODE]).
See [UNICODE]:
The Unicode Standard.
Unicode Consortium.
code
(Code
)
— codeWhether it matches (boolean
).
unicodeWhitespace(code)
Check whether the character code represents Unicode whitespace.
Note that this does handle micromark specific markdown whitespace characters.
See markdownLineEndingOrSpace
to check that.
A Unicode whitespace is a character in the Unicode Zs
(Separator,
Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
U+000C (FF), or U+000D CARRIAGE RETURN (CR) ([UNICODE]).
See [UNICODE]:
The Unicode Standard.
Unicode Consortium.
code
(Code
)
— codeWhether it matches (boolean
).
This package is fully typed with TypeScript. It exports no additional types.
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
micromark-util-character@2
, compatible with Node.js 16.
This package works with micromark@3
.
This package is safe.
See security.md
in micromark/.github
for how to
submit a security report.
See contributing.md
in micromark/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
1 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 1
Reason
Found 4/30 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More