@preaction/validation

2.0.6 • Public • Published

Preaction Validation

This is a small validation library for JavaScript using a simple signature for its functions.

Validator Function Signature

A validator function takes a single value argument and return a string. Validity is determined by the returned string's length.

Install

yarn

yarn add @preaction/validation

npm

npm install --save @preaction/validation

jsdelivr CDN

<script src="https://cdn.jsdelivr.net/npm/@preaction/validation@latest/dist/preaction-validation.umd.min.js"></script>

Remember to replace latest with the version number in production.

Importing Functions

ES Module

import { notEmptyValidator } from '@preaction/validation'

CommonJS Module

const { notEmptyValidator } = require('@preaction/validation')

IIFE

const { notEmptyValidator } = window['@preaction/validation']

API

See API.md.

Readme

Keywords

Package Sidebar

Install

npm i @preaction/validation

Weekly Downloads

1

Version

2.0.6

License

MIT

Unpacked Size

32 kB

Total Files

22

Last publish

Collaborators

  • dougelkin