README
is-word-character
Check if a character is a word character (\w
, which equals [a-zA-Z0-9_]
).
Install
This package is ESM only: Node 12+ is needed to use it and it must be import
ed
instead of require
d.
npm:
npm install is-word-character
Use
import {isWordCharacter} from 'is-word-character'
isWordCharacter('a') // => true
isWordCharacter('Z') // => true
isWordCharacter('0') // => true
isWordCharacter('_') // => true
isWordCharacter(' ') // => false
isWordCharacter('💩') // => false
API
This package exports the following identifiers: isWordCharacter
.
There is no default export.
isWordCharacter(character|code)
Check whether the given character code (number
), or the character code at the
first position (string
), is a word character.
Related
License
MIT © Titus Wormer