Check if a String is Numeric

GitMoji License: MIT Lines Of Code CodeQL

You can get this package by nest.land or deno.land.

Usage

This package exposes two Functions, isNumeric and isNumericSync.

import isNumeric, {
  isNumericSync,
} from "https://deno.land/x/is_number/mod.ts";

console.log(await isNumeric("hello")); // false

async function somethingAsync() {
  console.log(await isNumeric("123")); // true
}

somethingAsync();

isNumeric("hi").then((stringPossiblyNumerical) =>
  console.log(stringPossiblyNumerical)
); // false

console.log(isNumericSync("678")); // true

License

This project is licensed under the MIT License.