{"_id":"@cnaallotey/auto-form-filler","_rev":"3-1f3d2071851c23bae3cb05bf02bd87d6","name":"@cnaallotey/auto-form-filler","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@cnaallotey/auto-form-filler","version":"1.0.0","keywords":["form","autofill","query-params","automation","signup"],"author":{"name":"Your Name"},"license":"MIT","_id":"@cnaallotey/auto-form-filler@1.0.0","maintainers":[{"name":"cnaallotey","email":"charlesallotey1995@gmail.com"}],"homepage":"https://github.com/cnaallotey/auto-form-filler#readme","bugs":{"url":"https://github.com/cnaallotey/auto-form-filler/issues"},"dist":{"shasum":"68ec1219c69bc0cc77b9d35c1eb3df875be0eacf","tarball":"https://registry.npmjs.org/@cnaallotey/auto-form-filler/-/auto-form-filler-1.0.0.tgz","fileCount":6,"integrity":"sha512-ZUFLoBJ4/pscwLOzHtaIaD+aP6O5HDGnWIReuH4c+HYIzRRvCxkEzwKtSH8wycTwU1se2gwe8R7rMC46Bl1X4g==","signatures":[{"sig":"MEUCIQCXjKDdGdDilrO6ZPxRKi9UjpWv8LSjHiqpzWRJReprwAIgY28gtGP3u7+dKLBUUtuL83UIwcZ6wyb+j0bsrbRtGTo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26838},"jest":{"preset":"ts-jest","testMatch":["**/__tests__/**/*.test.ts"],"testEnvironment":"jsdom","collectCoverageFrom":["src/**/*.ts","!src/**/*.d.ts"]},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.esm.js","gitHead":"91d3b23c0b3a7e5bb5edbe7c82e56f95a8b8bd07","scripts":{"dev":"rollup -c -w","test":"jest","build":"rollup -c","test:watch":"jest --watch","test:coverage":"jest --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"cnaallotey","email":"charlesallotey1995@gmail.com"},"repository":{"url":"git+https://github.com/cnaallotey/auto-form-filler.git","type":"git"},"_npmVersion":"10.9.2","description":"Automatically populate and submit forms based on URL query parameters","directories":{},"_nodeVersion":"23.9.0","dependencies":{"tslib":"^2.6.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","rollup":"^3.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","jest-environment-jsdom":"^29.7.0","@rollup/plugin-typescript":"^11.0.0","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/auto-form-filler_1.0.0_1750085313374_0.22669815540901284","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@cnaallotey/auto-form-filler","version":"1.0.1","keywords":["form","autofill","query-params","automation","signup"],"author":{"name":"Your Name"},"license":"MIT","_id":"@cnaallotey/auto-form-filler@1.0.1","maintainers":[{"name":"cnaallotey","email":"charlesallotey1995@gmail.com"}],"homepage":"https://github.com/cnaallotey/auto-form-filler#readme","bugs":{"url":"https://github.com/cnaallotey/auto-form-filler/issues"},"dist":{"shasum":"31832cf8f4d001d728f1e3338d8ec080f3d506fa","tarball":"https://registry.npmjs.org/@cnaallotey/auto-form-filler/-/auto-form-filler-1.0.1.tgz","fileCount":6,"integrity":"sha512-pLdQyQoD4v7y4J0uEFumuyrjTg9EQWXy+MBwxSMGtFpAN28lbjNJ3LdiPV/VsT/9Eagbqf6+lxDXTYYL+JX4nQ==","signatures":[{"sig":"MEQCIAE5IyZ1I+0m9OTYYOiGK1W4w5sKhNuYo3h1Km5wAB1sAiAwEm0Qth+olLNkf6LhxcFfT+VZFn/ZPSUa+S55ipP4Zw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28869},"jest":{"preset":"ts-jest","testMatch":["**/__tests__/**/*.test.ts"],"testEnvironment":"jsdom","collectCoverageFrom":["src/**/*.ts","!src/**/*.d.ts"]},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.esm.js","gitHead":"6f306c307428119734931eff54f25ed916296f40","scripts":{"dev":"rollup -c -w","test":"jest","build":"rollup -c","test:watch":"jest --watch","test:coverage":"jest --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"cnaallotey","email":"charlesallotey1995@gmail.com"},"repository":{"url":"git+https://github.com/cnaallotey/auto-form-filler.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight library to automatically fill and submit forms based on URL query parameters","directories":{},"_nodeVersion":"23.9.0","dependencies":{"tslib":"^2.6.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","rollup":"^3.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","jest-environment-jsdom":"^29.7.0","@rollup/plugin-typescript":"^11.0.0","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/auto-form-filler_1.0.1_1750114946194_0.28360841059720987","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@cnaallotey/auto-form-filler","version":"1.1.0","type":"module","description":"A lightweight library to automatically fill and submit forms based on URL query parameters","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"build":"rollup -c","dev":"rollup -c -w","test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","prepublishOnly":"npm run build"},"keywords":["form","autofill","query-params","automation","signup"],"author":{"name":"Your Name"},"license":"MIT","dependencies":{"tslib":"^2.6.2"},"devDependencies":{"@rollup/plugin-node-resolve":"^15.0.0","@rollup/plugin-typescript":"^11.0.0","@types/jest":"^29.0.0","jest":"^29.0.0","jest-environment-jsdom":"^29.7.0","rollup":"^3.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0"},"repository":{"type":"git","url":"git+https://github.com/cnaallotey/auto-form-filler.git"},"publishConfig":{"access":"public"},"jest":{"preset":"ts-jest","testEnvironment":"jsdom","testMatch":["**/__tests__/**/*.test.ts"],"collectCoverageFrom":["src/**/*.ts","!src/**/*.d.ts"]},"_id":"@cnaallotey/auto-form-filler@1.1.0","gitHead":"6f306c307428119734931eff54f25ed916296f40","bugs":{"url":"https://github.com/cnaallotey/auto-form-filler/issues"},"homepage":"https://github.com/cnaallotey/auto-form-filler#readme","_nodeVersion":"23.9.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-LECKVcsR/bl5ZnvRzF99xC3xl/kUpYBLadsdv8VMiPQfmdsGIfy2mRgrVrhLAGrxnY6j/O4x1kdcw8nYN9Eu9A==","shasum":"670a6b0ef8da05cfd1ffbf0c8c116ceb3e062a35","tarball":"https://registry.npmjs.org/@cnaallotey/auto-form-filler/-/auto-form-filler-1.1.0.tgz","fileCount":6,"unpackedSize":31552,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC/kkIGl4qc62ElkbnQtbVFWZSZ+NjNCyJ+Z4viTaQLxQIhAOg6MxMhGYuOdF36BKfXervpfofwlXxfO4iXDYs6d43B"}]},"_npmUser":{"name":"cnaallotey","email":"charlesallotey1995@gmail.com","actor":{"name":"cnaallotey","email":"charlesallotey1995@gmail.com","type":"user"}},"directories":{},"maintainers":[{"name":"cnaallotey","email":"charlesallotey1995@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/auto-form-filler_1.1.0_1750249792685_0.21446552736335578"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-16T14:48:33.256Z","modified":"2025-06-18T12:29:53.026Z","1.0.0":"2025-06-16T14:48:33.604Z","1.0.1":"2025-06-16T23:02:26.405Z","1.1.0":"2025-06-18T12:29:52.861Z"},"bugs":{"url":"https://github.com/cnaallotey/auto-form-filler/issues"},"author":{"name":"Your Name"},"license":"MIT","homepage":"https://github.com/cnaallotey/auto-form-filler#readme","keywords":["form","autofill","query-params","automation","signup"],"repository":{"type":"git","url":"git+https://github.com/cnaallotey/auto-form-filler.git"},"description":"A lightweight library to automatically fill and submit forms based on URL query parameters","maintainers":[{"name":"cnaallotey","email":"charlesallotey1995@gmail.com"}],"readme":"[![CI](https://github.com/cnaallotey/auto-form-filler/actions/workflows/ci.yml/badge.svg)](https://github.com/cnaallotey/auto-form-filler/actions/workflows/ci.yml)\n[![npm version](https://img.shields.io/npm/v/@cnaallotey/auto-form-filler.svg)](https://www.npmjs.com/package/@cnaallotey/auto-form-filler)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# Auto Form Filler\n\nA lightweight, zero-dependency JavaScript library that automatically fills and submits forms based on URL query parameters. Perfect for marketing campaigns, lead generation, and form automation.\n\n## ✨ Features\n\n- 🎯 **Smart Form Filling**: Automatically fills form fields based on URL query parameters\n- 🔄 **Multiple Input Types**: Supports text, email, checkbox, radio, select, and more\n- 🛠️ **Customizable**: Flexible field mappings and configuration options\n- ⚡ **Auto-Submit**: Optional automatic form submission with configurable delay\n- 🔄 **Custom Submission**: Support for both native form submission and custom submit functions\n- 🔍 **Debug Mode**: Built-in debugging tools for development\n- 📦 **Zero Dependencies**: Lightweight and fast\n- 🎨 **TypeScript Support**: Full TypeScript definitions included\n- 🎮 **Event Hooks**: Custom callbacks for form submission and error handling\n\n## 📦 Installation\n\n```bash\n# Using npm\nnpm install @cnaallotey/auto-form-filler\n\n# Using yarn\nyarn add @cnaallotey/auto-form-filler\n\n# Using pnpm\npnpm add @cnaallotey/auto-form-filler\n```\n\n## 🚀 Quick Start\n\n```javascript\nimport { autoFillForm } from '@cnaallotey/auto-form-filler';\n\n// Initialize with default settings\nautoFillForm();\n```\n\n## ⚙️ Configuration\n\n### Basic Configuration\n\n```javascript\nimport { autoFillForm } from '@cnaallotey/auto-form-filler';\n\nautoFillForm({\n  formSelector: '#signup-form',\n  autoSubmit: true\n});\n```\n\n### Advanced Configuration\n\n```javascript\nimport { autoFillForm } from '@cnaallotey/auto-form-filler';\n\nautoFillForm({\n  formSelector: '#signup-form',\n  fieldMappings: {\n    custom_field: '#custom-input',\n    another_field: 'input[name=\"another\"]'\n  },\n  autoSubmit: true,\n  submitDelay: 2000,\n  debug: true,\n  // Custom submit function (optional)\n  customSubmitFunction: async (form, data) => {\n    // Example: Custom AJAX submission\n    const response = await fetch(form.action, {\n      method: form.method,\n      body: new FormData(form)\n    });\n    // Handle response\n    if (!response.ok) {\n      throw new Error('Form submission failed');\n    }\n  },\n  onBeforeSubmit: (form, data) => {\n    // Custom validation or processing before submit\n    return true; // Return false to prevent submission\n  },\n  onAfterSubmit: (form, data) => {\n    // Custom handling after submit\n    console.log('Form submitted with data:', data);\n  },\n  onError: (error) => {\n    // Custom error handling\n    console.error('An error occurred:', error);\n  }\n});\n```\n\n## 🔗 URL Query Parameters\n\nThe library automatically maps URL query parameters to form fields. For example:\n\n```\nhttps://example.com/signup?email=user@example.com&name=John%20Doe&company=Acme\n```\n\nThis will automatically fill:\n- Email field with \"user@example.com\"\n- Name field with \"John Doe\"\n- Company field with \"Acme\"\n\n## 🎯 Default Field Mappings\n\nThe library includes smart default mappings for common fields:\n\n| Parameter | Selectors |\n|-----------|-----------|\n| `email` | `input[name=\"email\"], input[type=\"email\"], #email` |\n| `name` | `input[name=\"name\"], input[name=\"fullname\"], #name, #fullname` |\n| `firstname` | `input[name=\"firstname\"], input[name=\"first_name\"], #firstname` |\n| `lastname` | `input[name=\"lastname\"], input[name=\"last_name\"], #lastname` |\n| `phone` | `input[name=\"phone\"], input[type=\"tel\"], #phone` |\n| `company` | `input[name=\"company\"], input[name=\"organization\"], #company` |\n| `utm_source` | `input[name=\"utm_source\"], #utm_source` |\n| `utm_medium` | `input[name=\"utm_medium\"], #utm_medium` |\n| `utm_campaign` | `input[name=\"utm_campaign\"], #utm_campaign` |\n\n## 📚 API Reference\n\n### `autoFillForm(config?: FormFillerConfig): AutoFormFiller`\n\nInitializes the form filler with optional configuration.\n\n### Configuration Options\n\n```typescript\ninterface FormFillerConfig {\n  /** CSS selector for the form element */\n  formSelector?: string;\n  \n  /** Custom field mappings */\n  fieldMappings?: Record<string, string>;\n  \n  /** Whether to automatically submit the form after filling */\n  autoSubmit?: boolean;\n  \n  /** Delay in milliseconds before auto-submitting */\n  submitDelay?: number;\n  \n  /** Custom submit function to handle form submission */\n  customSubmitFunction?: (form: HTMLFormElement, data: Record<string, string>) => Promise<void> | void;\n  \n  /** Callback before form submission */\n  onBeforeSubmit?: (form: HTMLFormElement, data: Record<string, string>) => boolean;\n  \n  /** Callback after form submission */\n  onAfterSubmit?: (form: HTMLFormElement, data: Record<string, string>) => void;\n  \n  /** Error handling callback */\n  onError?: (error: Error) => void;\n  \n  /** Enable debug mode */\n  debug?: boolean;\n}\n```\n\n## 🧪 Testing\n\n```bash\n# Run tests\nnpm test\n\n# Run tests with coverage\nnpm run test:coverage\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Thanks to all contributors who have helped shape this project\n- Inspired by the need for simpler form automation solutions \n","readmeFilename":"README.md"}