A powerful autofill plugin for form field automation using the Gofakeit API.
- 🎯 Smart Form Detection: Intelligent form field detection with smart-fill mode
- 🌐 API Integration: Seamless integration with Gofakeit API
- 🔧 TypeScript: Full TypeScript support with type definitions
- 📦 Modern Build: ES modules and CommonJS support with minification
- 🧪 Comprehensive Testing: Full test suite with Vitest and jsdom
- 🛠️ Extensible: Easy to add new input types and functions
npm install
The autofill()
function is the main entry point that handles all autofill scenarios:
import { autofill } from 'gofakeit'
// Autofill all form fields on the page
await autofill()
// Autofill all fields within a specific container
const form = document.getElementById('myForm')
await autofill(form)
// Autofill a single form element
const input = document.getElementById('email')
await autofill(input)
import { callFunc } from 'gofakeit'
// Fetch specific data
const data = await callFunc('person')
// Get available functions and utilities
import { hasFunc, getFuncs, type Func } from 'gofakeit'
// Check if a function exists
const isValid = hasFunc('person')
// Get all available functions
const allFunctions = getFuncs()
// Outputs
[
{
"value":"password",
"display":"Password",
"category":"auth"
},
{
"value":"gamertag",
"display":"Gamertag",
"category":"game"
}
// etc...
]
Start the development server with hot reload:
npm run dev
This will start a development server at http://localhost:5173
with an interactive example page demonstrating all autofill features.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request
MIT License - see LICENSE file for details.