-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update README and package.json for multiform-validator version…
… 2.6.1; adjust CDN links and examples
- Loading branch information
1 parent
f95b5da
commit 18fed90
Showing
2 changed files
with
18 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters