@cstan/is-digit
A commonjs package that returns true if its single character argument is a digit else false.
Installation:
npm install @cstan/is-digit
Use:
const { isDigit } = require("@cstan/is-digit")
let c = "k"; // a one char string
if (isDigit(c)) {
console.log(`'${c}' is a digit.`)
} else {
console.log(`'${c}' is NOT a digit.`)
}
// 'k' is NOT a digit.