{"_id":"@emravoan/koncaptcha","_rev":"4-fffd40d5f371477f6eb8a1cb182d4d4b","name":"@emravoan/koncaptcha","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@emravoan/koncaptcha","version":"1.0.0","keywords":["captcha","puzzle","slider","javascript","typescript","koncaptcha"],"author":{"name":"EM Ravoan"},"license":"MIT","_id":"@emravoan/koncaptcha@1.0.0","maintainers":[{"name":"emravoan","email":"eravoan@gmail.com"}],"homepage":"https://github.com/emravoan/koncaptcha#readme","bugs":{"url":"https://github.com/emravoan/koncaptcha/issues"},"dist":{"shasum":"2b303fb9075c6d066028b027f7d3f63b2c83950c","tarball":"https://registry.npmjs.org/@emravoan/koncaptcha/-/koncaptcha-1.0.0.tgz","fileCount":6,"integrity":"sha512-b0Dedbw2hCp6IJ4+T4IzZTeSb77wYvY2B+CoRYbLzGpDUJ9VJG6saueC9U+MDK9Zx0KFSRHywUVg763/9gv5bA==","signatures":[{"sig":"MEQCIFD5xaIqAOtnoTKyJ3DXiHvd2TWaju8yrj2FPYw+sHsGAiABWSOWfzrvsDpKPPLC6UyPWiKu9mcRb3op4xAa79LDJQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40319},"main":"dist/koncaptcha.cjs.js","type":"module","_from":"file:emravoan-koncaptcha-1.0.0.tgz","types":"dist/index.d.ts","unpkg":"dist/koncaptcha.umd.js","module":"dist/koncaptcha.es.js","exports":{".":{"import":"./dist/koncaptcha.es.js","require":"./dist/koncaptcha.cjs.js"}},"private":false,"scripts":{"dev":"vite","test":"vitest","build":"vite build && tsc --emitDeclarationOnly","prettier":"prettier --write ."},"_npmUser":{"name":"emravoan","email":"eravoan@gmail.com"},"jsdelivr":"dist/koncaptcha.umd.js","_resolved":"/tmp/b4f53baa002bdec4c00a32af50aada0c/emravoan-koncaptcha-1.0.0.tgz","_integrity":"sha512-b0Dedbw2hCp6IJ4+T4IzZTeSb77wYvY2B+CoRYbLzGpDUJ9VJG6saueC9U+MDK9Zx0KFSRHywUVg763/9gv5bA==","repository":{"url":"git+https://github.com/emravoan/koncaptcha.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight sliding puzzle CAPTCHA to protect websites from bots.","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.3.5","jsdom":"^26.1.0","vitest":"^3.1.4","prettier":"^3.5.3","typescript":"^5.8.3","tailwindcss":"^4.1.7","vite-plugin-dts":"^4.5.4","@tailwindcss/vite":"^4.1.7","vitest-canvas-mock":"^0.3.3","@testing-library/dom":"^10.4.0","vite-plugin-css-injected-by-js":"^3.5.2"},"_npmOperationalInternal":{"tmp":"tmp/koncaptcha_1.0.0_1748194441661_0.6503890057820867","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@emravoan/koncaptcha","version":"1.0.1","keywords":["captcha","puzzle","slider","javascript","typescript","koncaptcha"],"author":{"name":"EM Ravoan"},"license":"MIT","_id":"@emravoan/koncaptcha@1.0.1","maintainers":[{"name":"emravoan","email":"eravoan@gmail.com"}],"homepage":"https://github.com/emravoan/koncaptcha#readme","bugs":{"url":"https://github.com/emravoan/koncaptcha/issues"},"dist":{"shasum":"1fbfbd6ddb86c7aefec8e97a8139505b60629282","tarball":"https://registry.npmjs.org/@emravoan/koncaptcha/-/koncaptcha-1.0.1.tgz","fileCount":6,"integrity":"sha512-Id6vN3KynmGFf3SEaD716gC+2jBDT4GwkEpssB8+4YQhCK3UEheHeRxY3RpvJZzuvc3K53m0OlOwmMsoXM1o/A==","signatures":[{"sig":"MEUCIBLD6qxFS3jbeDmYD8nJP8uklc8K5e/nlV9k3BDF9UeYAiEA2suntFkLRPktTCTk9qaeWgrWEjqQ8joWoxCHdoAddNg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40366},"main":"dist/koncaptcha.cjs.js","type":"module","_from":"file:emravoan-koncaptcha-1.0.1.tgz","types":"dist/index.d.ts","unpkg":"dist/koncaptcha.umd.js","module":"dist/koncaptcha.es.js","exports":{".":{"import":"./dist/koncaptcha.es.js","require":"./dist/koncaptcha.cjs.js"}},"private":false,"scripts":{"dev":"vite","test":"vitest","build":"vite build && tsc --emitDeclarationOnly","prettier":"prettier --write ."},"_npmUser":{"name":"emravoan","email":"eravoan@gmail.com"},"jsdelivr":"dist/koncaptcha.umd.js","_resolved":"/tmp/9e5be0bfb8c3563fc7c234b4b0dcac37/emravoan-koncaptcha-1.0.1.tgz","_integrity":"sha512-Id6vN3KynmGFf3SEaD716gC+2jBDT4GwkEpssB8+4YQhCK3UEheHeRxY3RpvJZzuvc3K53m0OlOwmMsoXM1o/A==","repository":{"url":"git+https://github.com/emravoan/koncaptcha.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight sliding puzzle CAPTCHA to protect websites from bots.","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.3.5","jsdom":"^26.1.0","vitest":"^3.1.4","prettier":"^3.5.3","typescript":"^5.8.3","tailwindcss":"^4.1.7","vite-plugin-dts":"^4.5.4","@tailwindcss/vite":"^4.1.7","vitest-canvas-mock":"^0.3.3","@testing-library/dom":"^10.4.0","vite-plugin-css-injected-by-js":"^3.5.2"},"_npmOperationalInternal":{"tmp":"tmp/koncaptcha_1.0.1_1748195630407_0.5344176798920033","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@emravoan/koncaptcha","version":"1.0.2","keywords":["captcha","puzzle","slider","javascript","typescript","koncaptcha"],"author":{"name":"EM Ravoan"},"license":"MIT","_id":"@emravoan/koncaptcha@1.0.2","maintainers":[{"name":"emravoan","email":"eravoan@gmail.com"}],"homepage":"https://github.com/emravoan/koncaptcha#readme","bugs":{"url":"https://github.com/emravoan/koncaptcha/issues"},"dist":{"shasum":"81cea7de42ace07dcfabcd91ee0ec912e0770678","tarball":"https://registry.npmjs.org/@emravoan/koncaptcha/-/koncaptcha-1.0.2.tgz","fileCount":6,"integrity":"sha512-Hoppw+wq8UHRkNyVozN7EMaFthYCfFbekdw6q/4RtzwVXjupb8D12gP2pJSEZIW7YKHl7f79a6DVVBXIYldEFA==","signatures":[{"sig":"MEYCIQC/ggbN8X6mgr4BWbbFeEI8nVAHqUUvCOArf4T/ld2C4wIhAOy0j9qSXgMEAMxEYwXPyZklOWPTX6n+ek9WdemB5wm0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40402},"main":"dist/koncaptcha.cjs.js","type":"module","_from":"file:emravoan-koncaptcha-1.0.2.tgz","types":"dist/index.d.ts","unpkg":"dist/koncaptcha.umd.js","module":"dist/koncaptcha.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/koncaptcha.es.js","require":"./dist/koncaptcha.cjs.js"}},"private":false,"scripts":{"dev":"vite","test":"vitest","build":"vite build && tsc --emitDeclarationOnly","prettier":"prettier --write ."},"_npmUser":{"name":"emravoan","email":"eravoan@gmail.com"},"jsdelivr":"dist/koncaptcha.umd.js","_resolved":"/tmp/3a4faa43eecef36ea4e434b5217b1282/emravoan-koncaptcha-1.0.2.tgz","_integrity":"sha512-Hoppw+wq8UHRkNyVozN7EMaFthYCfFbekdw6q/4RtzwVXjupb8D12gP2pJSEZIW7YKHl7f79a6DVVBXIYldEFA==","repository":{"url":"git+https://github.com/emravoan/koncaptcha.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight sliding puzzle CAPTCHA to protect websites from bots.","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.3.5","jsdom":"^26.1.0","vitest":"^3.1.4","prettier":"^3.5.3","typescript":"^5.8.3","tailwindcss":"^4.1.7","vite-plugin-dts":"^4.5.4","@tailwindcss/vite":"^4.1.7","vitest-canvas-mock":"^0.3.3","@testing-library/dom":"^10.4.0","vite-plugin-css-injected-by-js":"^3.5.2"},"_npmOperationalInternal":{"tmp":"tmp/koncaptcha_1.0.2_1749460548890_0.05574813078326191","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@emravoan/koncaptcha","version":"1.0.3","private":false,"type":"module","description":"Lightweight sliding puzzle CAPTCHA to protect websites from bots.","author":{"name":"EM Ravoan"},"license":"MIT","main":"dist/koncaptcha.cjs.js","module":"dist/koncaptcha.es.js","unpkg":"dist/koncaptcha.umd.js","jsdelivr":"dist/koncaptcha.umd.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/koncaptcha.es.js","require":"./dist/koncaptcha.cjs.js"}},"keywords":["captcha","puzzle","slider","javascript","typescript","koncaptcha"],"repository":{"type":"git","url":"git+https://github.com/emravoan/koncaptcha.git"},"bugs":{"url":"https://github.com/emravoan/koncaptcha/issues"},"homepage":"https://github.com/emravoan/koncaptcha#readme","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"devDependencies":{"@tailwindcss/vite":"^4.1.7","@testing-library/dom":"^10.4.0","jsdom":"^26.1.0","prettier":"^3.5.3","tailwindcss":"^4.1.7","typescript":"^5.8.3","vite":"^6.3.5","vite-plugin-css-injected-by-js":"^3.5.2","vite-plugin-dts":"^4.5.4","vitest":"^3.1.4","vitest-canvas-mock":"^0.3.3"},"scripts":{"dev":"vite","test":"vitest","build":"vite build && tsc --emitDeclarationOnly","prettier":"prettier --write ."},"_id":"@emravoan/koncaptcha@1.0.3","_integrity":"sha512-ZFxp3aKKm3Jb7hhqGPqw901zl+XYHTFVEfDjqaSvqn6JQxCTLdmDoSUWALGk5q1YVsw4Rm4ZIGjsKhgZKGdNDA==","_resolved":"/tmp/9bf8621daeb62cb38c35d934ea3d4cfd/emravoan-koncaptcha-1.0.3.tgz","_from":"file:emravoan-koncaptcha-1.0.3.tgz","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-ZFxp3aKKm3Jb7hhqGPqw901zl+XYHTFVEfDjqaSvqn6JQxCTLdmDoSUWALGk5q1YVsw4Rm4ZIGjsKhgZKGdNDA==","shasum":"13ac5090a5637b605337baeb62e7d9ee008c2d6d","tarball":"https://registry.npmjs.org/@emravoan/koncaptcha/-/koncaptcha-1.0.3.tgz","fileCount":6,"unpackedSize":40852,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEnYIWeq3nNiDTueOAKuDW+QwhOGvZrCUlNIOJGs//KMAiEAoHbLcp8zklG+pHXyeBSnj8NtHAipslkQE6KgLWKS/4Q="}]},"_npmUser":{"name":"emravoan","email":"eravoan@gmail.com"},"directories":{},"maintainers":[{"name":"emravoan","email":"eravoan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/koncaptcha_1.0.3_1749462894849_0.4492241562504926"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-25T17:34:01.565Z","modified":"2025-06-09T09:54:55.204Z","1.0.0":"2025-05-25T17:34:01.861Z","1.0.1":"2025-05-25T17:53:50.605Z","1.0.2":"2025-06-09T09:15:49.109Z","1.0.3":"2025-06-09T09:54:55.029Z"},"bugs":{"url":"https://github.com/emravoan/koncaptcha/issues"},"author":{"name":"EM Ravoan"},"license":"MIT","homepage":"https://github.com/emravoan/koncaptcha#readme","keywords":["captcha","puzzle","slider","javascript","typescript","koncaptcha"],"repository":{"type":"git","url":"git+https://github.com/emravoan/koncaptcha.git"},"description":"Lightweight sliding puzzle CAPTCHA to protect websites from bots.","maintainers":[{"name":"emravoan","email":"eravoan@gmail.com"}],"readme":"<h1 align=\"center\">KonCaptcha - Sliding Puzzle CAPTCHA</h1>\n\n<div align=\"center\">\n\n![npm version](https://img.shields.io/npm/v/@emravoan/koncaptcha?style=flat-square)\n![GitHub last commit](https://img.shields.io/github/last-commit/emravoan/koncaptcha?style=flat-square)\n![GitHub issues](https://img.shields.io/github/issues/emravoan/koncaptcha?style=flat-square)\n![License](https://img.shields.io/github/license/emravoan/koncaptcha?style=flat-square)\n\nLightweight sliding puzzle CAPTCHA to protect websites from bots.\n\n</div>\n\n## 🖼️ Demo\n\n<img src=\"./demo.gif\" alt=\"konCaptcha Demo\" width=\"320\" />\n\n## 🚀 Features\n\n- Lightweight & Performant\n- Accessible and user-friendly\n- Framework Agnostic\n- Simple to Use\n- Fully Customizable\n- Zero Runtime Dependencies\n\n## 📦 Installation\n\n```bash\nnpm install @emravoan/koncaptcha\n# or\npnpm add @emravoan/koncaptcha\n# or\nyarn add @emravoan/koncaptcha\n```\n\n## 💡 Example\n\n```js\nimport konCaptcha from '@emravoan/koncaptcha';\n\nconst el = document.getElementById('captcha');\nconst kci = konCaptcha(el);\n\nkci.onAttempt(result => {\n  console.log(`Captcha verified: ${result.verified}`);\n});\n```\n\n## 📖 Usage\n\n#### HTML\n\n```html\n<div id=\"captcha\"></div>\n<button id=\"refresh\">Refresh</button>\n```\n\n#### JavaScript (ES Modules)\n\n```js\nimport konCaptcha from '@emravoan/koncaptcha';\n\nconst el = document.getElementById('captcha');\nconst kci = konCaptcha(el);\n\nkci.onAttempt(result => {\n  console.log(`Captcha verified: ${result.verified}`);\n});\n\n// Optional reset via button\n// document.getElementById('refresh').addEventListener('click', () => {\n//   kci.reset();\n// });\n```\n\n#### UMD (Browser)\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/@emravoan/koncaptcha/dist/koncaptcha.umd.js\"></script>\n<script>\n  const el = document.getElementById('captcha');\n  const kci = window.konCaptcha(el);\n\n  kci.onAttempt(result => {\n    console.log(`Captcha verified: ${result.verified}`);\n  });\n\n  // Optional reset via button\n  // document.getElementById('refresh').addEventListener('click', () => {\n  //   kci.reset();\n  // });\n</script>\n```\n\n## 📃 API\n\n#### `konCaptcha(element: HTMLElement, options?: IKonCaptchaOption): IKonCaptchaInstance`\n\n#### Options\n\n```ts\ninterface IKonCaptchaOption {\n  width?: number; // Optional. Width of the CAPTCHA container in pixels.\n  height?: number; // Optional. Height of the CAPTCHA container in pixels.\n  imgSrc?: string; // Optional. URL of the image to use for the CAPTCHA puzzle.\n  deviation?: number; // Optional. Allowed deviation for verification (in pixels).\n  wrapperClass?: string; // Optional. CSS class to apply to the main CAPTCHA wrapper element.\n}\n```\n\n#### Instance\n\n```ts\ninterface IKonCaptchaInstance {\n  reset: () => void;\n  onAttempt: (cb: (result: IKonCaptchaReturn) => void) => void;\n}\n\ninterface IKonCaptchaReturn {\n  verified: boolean;\n}\n```\n\n## 🛠️ Development\n\n```bash\ngit clone https://github.com/emravoan/koncaptcha.git\ncd koncaptcha\npnpm install\npnpm build\n```\n\n## 📄 License\n\nMIT\n\n## ❤️ Contributing\n\nIssues and PRs welcome!\n\n## 📞 Contact\n\nPlease use [GitHub Issues](https://github.com/emravoan/koncaptcha/issues) for questions or suggestions.\n","readmeFilename":"README.md"}