Skip to content

Commit

Permalink
chore: update README and package.json for multiform-validator version…
Browse files Browse the repository at this point in the history
… 2.6.1; adjust CDN links and examples
  • Loading branch information
gabriel-logan committed Feb 15, 2025
1 parent f95b5da commit 18fed90
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
38 changes: 17 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,65 +15,61 @@ Feel free to find bugs and report them to me. Your feedback is highly appreciate

## CDNs

### ESM:
### Default:

jsDelivr:

```bash
https://cdn.jsdelivr.net/npm/[email protected].0/+esm
https://cdn.jsdelivr.net/npm/[email protected].1/dist/index.min.js
```

```html
<script type="module">
import mv from "https://cdn.jsdelivr.net/npm/[email protected]/+esm"
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.min.js"></script>
```

### CJS:

jsDelivr:
unpkg:

```bash
https://cdn.jsdelivr.net/npm/[email protected].0/dist/index.min.js
https://unpkg.com/[email protected].1/dist/index.js
```

```html
<script src="https://cdn.jsdelivr.net/npm/[email protected].0/dist/index.min.js"></script>
<script src="https://unpkg.com/[email protected].1/dist/index.js"></script>
```

unpkg:
### ESM:

jsDelivr:

```bash
https://unpkg.com/[email protected].0/dist/index.js
https://cdn.jsdelivr.net/npm/[email protected].1/+esm
```

```html
<script src="https://unpkg.com/[email protected]/dist/index.js"></script>
<script type="module">
import mv from "https://cdn.jsdelivr.net/npm/[email protected]/+esm"
</script>
```

### Example of use with CDN

using cjs:

```html
<script src="https://unpkg.com/[email protected].0/dist/index.js"></script>
<script src="https://unpkg.com/[email protected].1/dist/index.js"></script>
<script>
// Multiform-validator is available in the global scope
const emailResult = isEmail("123456");
const cpfResult = cpfIsValid("123456");
console.log(emailResult); // returns false
console.log(cpfResult.isValid); // returns false
</script>
```
or

using esm:

```html
<script type="module">
// You can also import only the functions you need
// like: import { isEmail, cpfIsValid } from "https://cdn.jsdelivr.net/npm/[email protected].0/+esm";
import mv from "https://cdn.jsdelivr.net/npm/[email protected].0/+esm";
// like: import { isEmail, cpfIsValid } from "https://cdn.jsdelivr.net/npm/[email protected].1/+esm";
import mv from "https://cdn.jsdelivr.net/npm/[email protected].1/+esm";
const emailResult = mv.isEmail("123456");
const cpfResult = mv.cpfIsValid("123456");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "multiform-validator",
"version": "2.6.0",
"version": "2.6.1",
"description": "Javascript library made to validate, several form fields, such as: email, images, phone, password, cpf etc.",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down

0 comments on commit 18fed90

Please sign in to comment.