Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
is-alphanumerical
Advanced tools
The is-alphanumerical npm package is designed to check if a given input (string or character) is alphanumeric, meaning it consists of letters and numbers only. This can be particularly useful for validating user input, parsing content, or filtering data in applications where alphanumeric strings are required or expected.
Check if a string is alphanumeric
This feature allows you to verify if an entire string is alphanumeric. It returns true if the string contains only letters and numbers, and false otherwise.
"use strict"; var isAlphanumerical = require('is-alphanumerical'); console.log(isAlphanumerical('abc123')); // true console.log(isAlphanumerical('abc!123')); // false
Check if a single character is alphanumeric
This feature enables checking whether a single character is alphanumeric. It's useful for parsing or iterating through strings character by character to validate or process each one.
"use strict"; var isAlphanumerical = require('is-alphanumerical'); console.log(isAlphanumerical('a')); // true console.log(isAlphanumerical('!')); // false
Validator is a more comprehensive library for string validation and sanitization. It includes a function to check if a string is alphanumeric among many other validation functions. Compared to is-alphanumerical, validator is more versatile but also larger in size, making is-alphanumerical a lightweight alternative for specific alphanumeric checks.
Is-alphanumeric is another package with a similar purpose, offering functionality to check if strings or characters are alphanumeric. The main difference lies in the implementation details and possibly in performance benchmarks, but both serve the same primary purpose.
Check if a character is alphanumerical.
This is a function that checks if a given character is ASCII alphanumerical:
it matches [a-zA-Z0-9]
.
Not often, as it’s relatively simple to do yourself. This package exists because it’s needed in several related packages, at which point it becomes useful to defer to one shared function.
This package is ESM only. In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm:
npm install is-alphanumerical
In Deno with Skypack:
import {isAlphanumerical} from 'https://cdn.skypack.dev/is-alphanumerical@2?dts'
In browsers with Skypack:
<script type="module">
import {isAlphanumerical} from 'https://cdn.skypack.dev/is-alphanumerical@2?min'
</script>
import {isAlphanumerical} from 'is-alphanumerical'
isAlphanumerical('a') // => true
isAlphanumerical('Z') // => true
isAlphanumerical('0') // => true
isAlphanumerical(' ') // => false
isAlphanumerical('💩') // => false
This package exports the following identifier: isAlphanumerical
.
There is no default export.
isAlphanumerical(character)
Check whether the given character code (number
), or the character code at the
first position (string
), is alphanumerical.
This package is fully typed with TypeScript.
This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 12.20+, 14.14+, and 16.0+. It also works in Deno and modern browsers.
This package is safe.
wooorm/is-alphabetical
wooorm/is-decimal
wooorm/is-hexadecimal
wooorm/is-whitespace-character
wooorm/is-word-character
Yes please! See How to Contribute to Open Source.
FAQs
Check if a character is alphanumerical
The npm package is-alphanumerical receives a total of 4,908,205 weekly downloads. As such, is-alphanumerical popularity was classified as popular.
We found that is-alphanumerical demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.