# js-data-form

> Form abstraction to process data

Latest version **0.1.4** (published 2016-03-26) · LGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install js-data-form
pnpm add js-data-form
yarn add js-data-form
bun add js-data-form
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2016-03-26 |
| First published | 2016-03-11 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ahami3000 |
| Maintainers | ahami3000 |
| Keywords | form, data |

## Links

- npm: https://www.npmjs.com/package/js-data-form
- npm.io page: https://npm.io/package/js-data-form

## Dependencies (1)

- [is-my-json-valid](https://npm.io/package/is-my-json-valid.md) ^2.13.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2016-03-26
- 0.1.3 — 2016-03-26
- 0.1.1 — 2016-03-26
- 0.1.0 — 2016-03-11

## README

# js-data-form

Form abstraction to clean, validate, and serialize data

## How to use

    var DataForm = require('js-data-form');

    var form = new DataForm({
        fields: {
            field1: {
                type: 'string',
                minLength: 5,
                maxLength: 10
            },
            field2: {
                type: 'object',
                properties: {
                    prop1: {type: 'string'},
                    prop2: {type: 'string'}
                },
                additionalProperties: flase
            }
            ...
        }
    });

    var {isValid, errors} = form.validate({
        field1: 'lorem ipsum',
        field2: {
            prop1: 'dolor',
            prop2: 'siet'
        }
    });

    var filtered = form.filter({
        field1: 'lorem ipsum',
        field2: {
            prop1: 'dolor',
            prop2: 'siet'
        },
        field3: 'lorem2'
    });

    // filtered = {
    //     field1: 'lorem ipsum',
    //     field2: {
    //         prop1: 'dolor',
    //         prop2: 'siet'
    //     }
    // }

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