# input-preloader-js

> Javascript plugin to preload form inputs on the web

Latest version **2.0.1** (published 2019-12-13) · Apache 2.0 license · 0 weekly downloads

## Install

```sh
npm install input-preloader-js
pnpm add input-preloader-js
yarn add input-preloader-js
bun add input-preloader-js
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2019-12-13 |
| First published | 2019-11-02 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Zaim Ramlan |
| Maintainers | zaimramlan |
| Keywords | form, pre-loader, reload, page, javascript |

## Links

- npm: https://www.npmjs.com/package/input-preloader-js
- Repository: https://github.com/pakej/input-preloader-js
- Homepage: https://github.com/pakej/input-preloader-js#readme
- Issues: https://github.com/pakej/input-preloader-js/issues
- npm.io page: https://npm.io/package/input-preloader-js

## 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

- 2.0.1 (latest) — 2019-12-13
- 2.0.0 — 2019-11-02

## README

# InputPreloader for JavaScript
![npm](https://img.shields.io/npm/v/input-preloader-js)

A simple input preloader to preload inputs on the web.

## Installation
### <img src="https://avatars1.githubusercontent.com/u/22247014?s=200&v=4" width="20" height="20"> Yarn
```bash
$ yarn add input-preloader-js
```

### <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/npm/npm.png" width="20" height="20"> NPM
```bash
$ npm install input-preloader-js
```

## Usage
1. Assuming you have the following form inputs and id attributes
    ```html
    <input type="radio" name="a-radio" id="a-radio"> Text for radio
    <input type="float" name="a-float" id="a-float">
    <input type="integer" name="a-integer" id="a-integer">
    <input type="string" name="a-string" id="a-string">
    ```

1. Require the InputPreloader
    ```javascript
    var InputPreloader = require("input-preloader-js");
    ```

1. Initialize the InputPreloader with your inputs and their input types
    ```javascript
    var inputs = [
        "a-radio:radio",
        "a-float:float",
        "a-integer:integer",
        "a-string:string"
    ];
    var preloader = new InputPreloader(inputs);
    ```

1. Configure the InputPreloader to preload inputs on page load, and save inputs before moving away from the page.
    ```javascript
    preloader.configure();
    ```

1. That's it! Now the inputs will be preloaded everytime the page is loaded by the user.

1. In the case where you are done with the form, and doesn't need to preload the inputs anymore, call `deconfigure()` to remove all stored inputs.
    ```javascript
    preloader.deconfigure();
    ```

## Contributing
We'd love to accept your patches and contributions to this project! Checkout [contributing](CONTRIBUTING.md) and [code of conduct](CODE_OF_CONDUCT.md) to learn more.

## License
Refer to the license file.

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