# jscommonregex

> A node.js package for common regular expressions.

Latest version **1.0.2** (published 2023-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install jscommonregex
pnpm add jscommonregex
yarn add jscommonregex
bun add jscommonregex
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-01-25 |
| First published | 2023-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | fadedreams7 |
| Maintainers | fadedreams7 |
| Keywords | regex |

## Links

- npm: https://www.npmjs.com/package/jscommonregex
- Repository: https://github.com/FadeDreams/jsCommonRegex
- Issues: https://github.com/FadeDreams/jsCommonRegex/issues
- npm.io page: https://npm.io/package/jscommonregex

## Recent versions

- 1.0.2 (latest) — 2023-01-25
- 1.0.1 — 2023-01-25

## README

# node-common-regex

A Node.js package that exports functions to validate various types of data using regular expressions.

### Installation

```javascript
npm install jscommonregex
```

### Usage

```javascript
import {
  IsInt,
  IsPositiveInt,
  IsDecimalNum,
  IsNum,
  IsAlphaNumeric,
  IsAlphaNumericWithSpace,
  IsEmail,
  IsGoodPassword,
  IsUsername,
  IsURL,
  IsIPv4,
  IsIPv6,
} from "jscommonregex";

console.log(IsInt(10)); // true
console.log(IsInt("10")); // false
console.log(IsPositiveInt("10")); // true
console.log(IsDecimalNum("10.2")); // true
console.log(IsNum("10.2")); // true
console.log(IsNum("-10.2")); // true
console.log(IsAlphaNumeric("hello123")); // true
console.log(IsAlphaNumericWithSpace("hello 123")); // true
console.log(IsEmail("example@email.com")); // true
console.log(IsGoodPassword("Abcdefg1@")); // true
console.log(IsUsername("john_doe")); // true
console.log(IsURL("https://www.example.com")); // true
console.log(IsIPv4("192.168.0.1")); // true
console.log(IsIPv6("2001:0db8:85a3:0000:0000:8a2e:0370:7334")); // true
```

### License

MIT

### Note

Please note that these regular expressions are not foolproof and might not cover all possible cases. They are meant to be used as a basic validation tool and not as a definitive solution.

---
_Source: https://npm.io/package/jscommonregex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
