0.0.2 • Published 1 year ago

fill-autocomplete v0.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

fill-autocomplete

Small util library to help filling input fields with autocomplete.

If passed an object with keys matching the autocomplete attribute, the library will attempt to query and then fill the input fields.

Usage

import {attemptAutofill} from 'fill-autocomplete';

const attributesToFill = {
  'given-name': 'John',
  'family-name': 'Doe',
  'email': 'your@email',
}

const queryFn = (selector) => document.querySelector(selector);

attemptAutofill(attributesToFill, queryFn);

As seen above, the query function can be changed based on your needs (think Playwright, Puppeteer, etc.).

There is also a attemptAutofillDocumentQuerySelctor export that does the above for you.

0.0.2

1 year ago

0.0.1

1 year ago