AK-21/Graphite-Industrial-Intelligence
0
1# is-alphanumerical2 3[![Build][build-badge]][build]4[![Coverage][coverage-badge]][coverage]5[![Downloads][downloads-badge]][downloads]6[![Size][size-badge]][size]7 8Check if a character is alphanumerical.9 10## Contents11 12* [What is this?](#what-is-this)13* [When should I use this?](#when-should-i-use-this)14* [Install](#install)15* [Use](#use)16* [API](#api)17 * [`isAlphanumerical(character)`](#isalphanumericalcharacter)18* [Types](#types)19* [Compatibility](#compatibility)20* [Security](#security)21* [Related](#related)22* [Contribute](#contribute)23* [License](#license)24 25## What is this?26 27This is a function that checks if a given character is ASCII alphanumerical:28it matches `[a-zA-Z0-9]`.29 30## When should I use this?31 32Not often, as it’s relatively simple to do yourself.33This package exists because it’s needed in several related packages, at which34point it becomes useful to defer to one shared function.35 36## Install37 38This package is [ESM only][esm].39In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:40 41```sh42npm install is-alphanumerical43```44 45In Deno with [Skypack][]:46 47```js48import {isAlphanumerical} from 'https://cdn.skypack.dev/is-alphanumerical@2?dts'49```50 51In browsers with [Skypack][]:52 53```html54<script type="module">55 import {isAlphanumerical} from 'https://cdn.skypack.dev/is-alphanumerical@2?min'56</script>57```58 59## Use60 61```js62import {isAlphanumerical} from 'is-alphanumerical'63 64isAlphanumerical('a') // => true65isAlphanumerical('Z') // => true66isAlphanumerical('0') // => true67isAlphanumerical(' ') // => false68isAlphanumerical('💩') // => false69```70 71## API72 73This package exports the following identifier: `isAlphanumerical`.74There is no default export.75 76### `isAlphanumerical(character)`77 78Check whether the given character code (`number`), or the character code at the79first position (`string`), is alphanumerical.80 81## Types82 83This package is fully typed with [TypeScript][].84 85## Compatibility86 87This package is at least compatible with all maintained versions of Node.js.88As of now, that is Node.js 12.20+, 14.14+, and 16.0+.89It also works in Deno and modern browsers.90 91## Security92 93This package is safe.94 95## Related96 97* [`wooorm/is-alphabetical`](https://github.com/wooorm/is-alphabetical)98* [`wooorm/is-decimal`](https://github.com/wooorm/is-decimal)99* [`wooorm/is-hexadecimal`](https://github.com/wooorm/is-hexadecimal)100* [`wooorm/is-whitespace-character`](https://github.com/wooorm/is-whitespace-character)101* [`wooorm/is-word-character`](https://github.com/wooorm/is-word-character)102 103## Contribute104 105Yes please!106See [How to Contribute to Open Source][contribute].107 108## License109 110[MIT][license] © [Titus Wormer][author]111 112<!-- Definitions -->113 114[build-badge]: https://github.com/wooorm/is-alphanumerical/workflows/main/badge.svg115 116[build]: https://github.com/wooorm/is-alphanumerical/actions117 118[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-alphanumerical.svg119 120[coverage]: https://codecov.io/github/wooorm/is-alphanumerical121 122[downloads-badge]: https://img.shields.io/npm/dm/is-alphanumerical.svg123 124[downloads]: https://www.npmjs.com/package/is-alphanumerical125 126[size-badge]: https://img.shields.io/bundlephobia/minzip/is-alphanumerical.svg127 128[size]: https://bundlephobia.com/result?p=is-alphanumerical129 130[npm]: https://docs.npmjs.com/cli/install131 132[skypack]: https://www.skypack.dev133 134[license]: license135 136[author]: https://wooorm.com137 138[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c139 140[typescript]: https://www.typescriptlang.org141 142[contribute]: https://opensource.guide/how-to-contribute/143 