{"_id":"@cantabile/hooks","_rev":"8-cb299fc485abc3c97a3e9e83f16c3a5d","name":"@cantabile/hooks","dist-tags":{"latest":"1.2.1"},"versions":{"1.0.0":{"name":"@cantabile/hooks","version":"1.0.0","author":{"url":"https://github.com/champclarinet","name":"Wallop Opasakhun"},"license":"ISC","_id":"@cantabile/hooks@1.0.0","maintainers":[{"name":"cantabile","email":"champbassist159@gmail.com"}],"homepage":"https://github.com/ChampClarinet/hooks#readme","bugs":{"url":"https://github.com/ChampClarinet/hooks/issues"},"dist":{"shasum":"d3da19bade42deb1104630641885400fc397dbe6","tarball":"https://registry.npmjs.org/@cantabile/hooks/-/hooks-1.0.0.tgz","fileCount":32,"integrity":"sha512-VHRyLuBxz7nxVENsDHecGKusZOSw32dqLe9xZcwgay/CksnZ4bMVSVcrlJMCRz2l1hm5xoODQ2SNKGWZiVOumQ==","signatures":[{"sig":"MEUCIQDi7thvGVnNqGYn+zGAQKo70zvnvbUS++mydKtCvfV7yQIgcSKCVuCemBr7Sykx3qa94v4+yMme09eohl8m5h6t5Ss=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36127},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"e2c4f3d656fc36de815596b777636613447d9711","scripts":{"test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"cantabile","email":"champbassist159@gmail.com"},"repository":{"url":"git+https://github.com/ChampClarinet/hooks.git","type":"git"},"_npmVersion":"9.5.0","description":"React hooks snippets","directories":{},"_nodeVersion":"18.15.0","dependencies":{"axios":"^1.6.7","react":"^18.2.0","@types/axios":"^0.14.0","react-router-dom":"^6.22.0","@cantabile/date-helper":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.3.3","@types/jest":"^29.5.12","@types/react":"^18.2.55"},"_npmOperationalInternal":{"tmp":"tmp/hooks_1.0.0_1707394188824_0.920662712531217","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@cantabile/hooks","version":"1.0.1","author":{"url":"https://github.com/champclarinet","name":"Wallop Opasakhun"},"license":"ISC","_id":"@cantabile/hooks@1.0.1","maintainers":[{"name":"cantabile","email":"champbassist159@gmail.com"}],"homepage":"https://github.com/ChampClarinet/hooks#readme","bugs":{"url":"https://github.com/ChampClarinet/hooks/issues"},"dist":{"shasum":"17bba067e7db53faf32b1a0b93f0db1d7feb2ca8","tarball":"https://registry.npmjs.org/@cantabile/hooks/-/hooks-1.0.1.tgz","fileCount":32,"integrity":"sha512-bD2jtkOQx5f8SNmZ2GDtqB+5MbPPLYpQju8H98qOGfc5WYF1FESjHEd3DvY3ajFOF6lS4v+9ZzzIUUH2XPYDhQ==","signatures":[{"sig":"MEQCIB51flk2p7jhpQWS0U+IikDBl+z98KvOlHys2dxdXN/2AiBc1WMqn7wlzaJirM8WnBkUC4WurGR12sVFr/9dSGl7Sw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39113},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"f4c952a843c40644be175283a146714296b241ac","scripts":{"test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"cantabile","email":"champbassist159@gmail.com"},"repository":{"url":"git+https://github.com/ChampClarinet/hooks.git","type":"git"},"_npmVersion":"9.5.0","description":"React hooks snippets","directories":{},"_nodeVersion":"18.15.0","dependencies":{"axios":"^1.6.7","react":"^18.2.0","@types/axios":"^0.14.0","react-router-dom":"^6.22.0","@cantabile/date-helper":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.3.3","@types/jest":"^29.5.12","@types/react":"^18.2.55"},"_npmOperationalInternal":{"tmp":"tmp/hooks_1.0.1_1707394346663_0.3935125214208768","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@cantabile/hooks","version":"1.1.0","author":{"url":"https://github.com/champclarinet","name":"Wallop Opasakhun"},"license":"ISC","_id":"@cantabile/hooks@1.1.0","maintainers":[{"name":"cantabile","email":"champbassist159@gmail.com"}],"homepage":"https://github.com/ChampClarinet/hooks#readme","bugs":{"url":"https://github.com/ChampClarinet/hooks/issues"},"dist":{"shasum":"4b9cbc7082481f29ade5dab44c85f0986bf2f08e","tarball":"https://registry.npmjs.org/@cantabile/hooks/-/hooks-1.1.0.tgz","fileCount":32,"integrity":"sha512-zzcRNkSXa4TVD7MEtxPnCq/0m+aq7034DjHujZS+6FoLLG9IM92GsOQcJU8f48SppTuNZQMyAsTQr+nBtDkoNA==","signatures":[{"sig":"MEYCIQC5rNeIaa18w7vRabGuplCVmZV1zqfb6HWkygntdq9WjwIhALj/8XQ8RVXgIPbNS929eHrtvZrEm9+Do5EyDzsG/Q/Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39793},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"bf55e0a670e269eec7a055d4d410f3323187a911","scripts":{"test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"cantabile","email":"champbassist159@gmail.com"},"repository":{"url":"git+https://github.com/ChampClarinet/hooks.git","type":"git"},"_npmVersion":"9.5.0","description":"React hooks snippets","directories":{},"_nodeVersion":"18.15.0","dependencies":{"axios":"^1.6.7","react":"^18.2.0","@types/axios":"^0.14.0","react-router-dom":"^6.22.0","@cantabile/date-helper":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.3.3","@types/jest":"^29.5.12","@types/react":"^18.2.55"},"_npmOperationalInternal":{"tmp":"tmp/hooks_1.1.0_1707853278354_0.09983247650757132","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@cantabile/hooks","version":"1.1.1","author":{"url":"https://github.com/champclarinet","name":"Wallop Opasakhun"},"license":"ISC","_id":"@cantabile/hooks@1.1.1","maintainers":[{"name":"cantabile","email":"champbassist159@gmail.com"}],"homepage":"https://github.com/ChampClarinet/hooks#readme","bugs":{"url":"https://github.com/ChampClarinet/hooks/issues"},"dist":{"shasum":"b32dc7fb425a2c955549013299aa3a809ec3fa37","tarball":"https://registry.npmjs.org/@cantabile/hooks/-/hooks-1.1.1.tgz","fileCount":36,"integrity":"sha512-CMsOCkBRGEBpC1BGNgsuKjxsIlpEPpgU273AosU1MhNycOsupLAgIulFpw2G1pTUv3O7Who1GkEXRdIR7KMa0w==","signatures":[{"sig":"MEYCIQDr/cXVxITvJ2FkkIlHxWdJSmrWxKyotolSYEWYBHfPpAIhAL/4+YNUnNdbffVjAHPU3WYUQ69b7nhBdac7HrKcdsSC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41455},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"bf55e0a670e269eec7a055d4d410f3323187a911","scripts":{"test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"cantabile","email":"champbassist159@gmail.com"},"repository":{"url":"git+https://github.com/ChampClarinet/hooks.git","type":"git"},"_npmVersion":"9.5.0","description":"React hooks snippets","directories":{},"_nodeVersion":"18.15.0","dependencies":{"axios":"^1.6.7","react":"^18.2.0","@types/axios":"^0.14.0","react-router-dom":"^6.22.0","@cantabile/date-helper":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.3.3","@types/jest":"^29.5.12","@types/react":"^18.2.55"},"_npmOperationalInternal":{"tmp":"tmp/hooks_1.1.1_1707853755664_0.08021692468631647","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"@cantabile/hooks","version":"1.1.2","author":{"url":"https://github.com/champclarinet","name":"Wallop Opasakhun"},"license":"ISC","_id":"@cantabile/hooks@1.1.2","maintainers":[{"name":"cantabile","email":"champbassist159@gmail.com"}],"homepage":"https://github.com/ChampClarinet/hooks#readme","bugs":{"url":"https://github.com/ChampClarinet/hooks/issues"},"dist":{"shasum":"e866c7740a50d85cb05c13c756c972c2fe79e41b","tarball":"https://registry.npmjs.org/@cantabile/hooks/-/hooks-1.1.2.tgz","fileCount":36,"integrity":"sha512-Q4JhLtXNAWYVAEUFxVOsZHHOsxqOwoo4ERIAf9+gjMgD07iBHXNoexgVGT+n+iovX6h5JMXfaQG+CNeBg9cwIg==","signatures":[{"sig":"MEYCIQCQB36R31Be35bdkvXI3p8WhLCe0mUixx8CFt7TKT0rgwIhAPjMiQmsb3gUAcjKtphCmZVYIvF6W0R+qOoPcfLvpsXe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41424},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"089f15938d3ac9cd50e092732f32a9258cc03571","scripts":{"test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"cantabile","email":"champbassist159@gmail.com"},"repository":{"url":"git+https://github.com/ChampClarinet/hooks.git","type":"git"},"_npmVersion":"9.5.0","description":"React hooks snippets","directories":{},"_nodeVersion":"18.15.0","dependencies":{"axios":"^1.6.7","react":"^18.2.0","react-router-dom":"^6.22.0","@cantabile/date-helper":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.3.3","@types/jest":"^29.5.12","@types/react":"^18.2.55"},"_npmOperationalInternal":{"tmp":"tmp/hooks_1.1.2_1707853904269_0.5258642881354558","host":"s3://npm-registry-packages"}},"1.1.3":{"name":"@cantabile/hooks","version":"1.1.3","author":{"url":"https://github.com/champclarinet","name":"Wallop Opasakhun"},"license":"ISC","_id":"@cantabile/hooks@1.1.3","maintainers":[{"name":"cantabile","email":"champbassist159@gmail.com"}],"homepage":"https://github.com/ChampClarinet/hooks#readme","bugs":{"url":"https://github.com/ChampClarinet/hooks/issues"},"dist":{"shasum":"bf375d40cacb110f426c4f5b26a8b5cd7d83fc43","tarball":"https://registry.npmjs.org/@cantabile/hooks/-/hooks-1.1.3.tgz","fileCount":36,"integrity":"sha512-cJ9CGYAa2y5pb3DJHeu3IIk1dfK6062Pk87RtAISe4pTJiucuDaiqJhkeTnGeGuNjhVh4LkKeBjIDx9Tb++edA==","signatures":[{"sig":"MEQCIGAOjnINVO+I3ujQ5dOqcceJHfK2FBDrxER1nuf0zVtOAiBg4jCUbOD3NNdf8VH25oJcilP9j9xJ4N5EuchC4QgfEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41867},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"cc40d4639c127d2fbeec3aae775d48981d6f0eff","scripts":{"test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"cantabile","email":"champbassist159@gmail.com"},"repository":{"url":"git+https://github.com/ChampClarinet/hooks.git","type":"git"},"_npmVersion":"9.5.0","description":"React hooks snippets","directories":{},"_nodeVersion":"18.15.0","dependencies":{"axios":"^1.6.7","react":"^18.2.0","react-router-dom":"^6.22.0","@cantabile/date-helper":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.3.3","@types/jest":"^29.5.12","@types/react":"^18.2.55"},"_npmOperationalInternal":{"tmp":"tmp/hooks_1.1.3_1733212443095_0.29434717762674567","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@cantabile/hooks","version":"1.2.0","author":"Wallop Opasakhun (https://github.com/champclarinet)","license":"ISC","_id":"@cantabile/hooks@1.2.0","maintainers":[{"name":"cantabile","email":"champbassist159@gmail.com"}],"homepage":"https://github.com/ChampClarinet/hooks#readme","bugs":{"url":"https://github.com/ChampClarinet/hooks/issues"},"dist":{"shasum":"7dfe56d9078f0fc032e0f82c2dcf37b793530a96","tarball":"https://registry.npmjs.org/@cantabile/hooks/-/hooks-1.2.0.tgz","fileCount":17,"integrity":"sha512-8hWyxwO8UZEHVINptkxgbUFU3NdTuThkF9UL12xWEUgpbkXlHru55FtaTY68LpBswqwGEjwg2RuOP0G9EUbjyA==","signatures":[{"sig":"MEUCIFhwHwbd+Xw8cQkaEosq/pdGZXSECXPDHiGK+07gYaDFAiEAgjkoxRrvBtsBapTbAks3ZUR6GRHpCM5ccsyAuMyWW7w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2269949},"main":"dist/index.cjs","types":"dist/index.d.ts","config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"./cz.config.cjs"}},"module":"dist/index.mjs","shasum":"7dfe56d9078f0fc032e0f82c2dcf37b793530a96","engines":{"bun":">=1.3.0","node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./url-react":{"types":"./dist/url/react-router.d.ts","import":"./dist/url/react-router.js","require":"./dist/url/react-router.cjs"},"./url-next-app":{"types":"./dist/url/next-app.d.ts","import":"./dist/url/next-app.js","require":"./dist/url/next-app.cjs"}},"scripts":{"lint":"bunx eslint . --ext ts,tsx,js,jsx","test":"bun test","build":"bun run clean && bun run prebuild && bun run build:esm && bun run build:cjs && bun run build:esm:url && bun run build:cjs:url && bun run build:types","clean":"rm -rf dist","commit":"cz","format":"prettier -w .","lint:fix":"bunx eslint . --ext ts,tsx,js,jsx --fix","prebuild":"node scripts/gen-barrel.mjs","build:cjs":"bun build src/index.ts --outdir dist --target=node --format=cjs --sourcemap --outfile=index.cjs --external:react --external:react-dom --external:react-router-dom","build:esm":"bun build src/index.ts --outdir dist --target=node --format=esm --sourcemap --outfile=index.mjs --external:react --external:react-dom --external:react-router-dom","build:types":"tsc -p tsconfig.build.json","build:cjs:url":"bun build src/url/*.ts --outdir dist/url --target=node --format=cjs --sourcemap --external:react --external:react-dom --external:react-router-dom --external:next --external:next/*","build:esm:url":"bun build src/url/*.ts --outdir dist/url --target=node --format=esm --sourcemap --external:react --external:react-dom --external:react-router-dom --external:next --external:next/*","prepublishOnly":"bun run build"},"_npmUser":{"name":"cantabile","email":"champbassist159@gmail.com"},"_integrity":"sha512-8hWyxwO8UZEHVINptkxgbUFU3NdTuThkF9UL12xWEUgpbkXlHru55FtaTY68LpBswqwGEjwg2RuOP0G9EUbjyA==","repository":{"url":"git+https://github.com/ChampClarinet/hooks.git","type":"git"},"_npmVersion":"10.8.3","description":"React hooks snippets for modern React (18 & 19)","directories":{},"lint-staged":{"*.{js,ts,jsx,tsx,json,css,md}":["prettier --write","git add"]},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"axios":"^1.6.7","@cantabile/date-helper":"latest"},"typesVersions":{"*":{"url-react":["dist/url/react-router.d.ts"],"url-next-app":["dist/url/next-app.d.ts"]}},"_hasShrinkwrap":false,"packageManager":"bun@1.3.0","devDependencies":{"next":"^15.3.2","husky":"^9.1.7","react":"^19.1.0","eslint":"^9.25.1","globals":"^16.0.0","prettier":"^3.6.2","bun-types":"latest","react-dom":"^19.1.0","@eslint/js":"^9.25.1","commitizen":"^4.3.1","commitlint":"^20.1.0","typescript":"^5.6.3","lint-staged":"^16.2.4","cz-customizable":"^7.5.1","react-router-dom":"^6.26.2","typescript-eslint":"^8.31.0","commitlint-config-gitmoji":"^2.3.1","eslint-plugin-react-hooks":"^5.2.0","prettier-plugin-tailwindcss":"^0.7.0","@trivago/prettier-plugin-sort-imports":"^5.2.2"},"peerDependencies":{"next":"^13.4.0 || ^14.0.0 || ^15.0.0","react":"^18.2.0 || ^19.0.0","react-dom":"^18.2.0 || ^19.0.0","react-router-dom":"^6.26.0"},"peerDependenciesMeta":{"next":{"optional":true},"react-router-dom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/hooks_1.2.0_1760701830002_0.46398477336238386","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@cantabile/hooks","version":"1.2.1","description":"React hooks snippets for modern React (18 & 19)","homepage":"https://github.com/ChampClarinet/hooks#readme","author":{"name":"Wallop Opasakhun","url":"https://github.com/champclarinet"},"main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"},"./url-react":{"types":"./dist/url/react-router.d.ts","default":"./dist/url/react-router.js","import":"./dist/url/react-router.js","require":"./dist/url/react-router.js"},"./url-next-app":{"types":"./dist/url/next-app.d.ts","default":"./dist/url/next-app.js","import":"./dist/url/next-app.js","require":"./dist/url/next-app.js"}},"typesVersions":{"*":{"url-react":["dist/url/react-router.d.ts"],"url-next-app":["dist/url/next-app.d.ts"]}},"sideEffects":false,"packageManager":"bun@1.3.0","license":"ISC","repository":{"type":"git","url":"git+https://github.com/ChampClarinet/hooks.git"},"bugs":{"url":"https://github.com/ChampClarinet/hooks/issues"},"scripts":{"clean":"rm -rf dist","prebuild":"node scripts/gen-barrel.mjs","build":"bun run clean && tsc -p tsconfig.build.json","test":"bun test","prepublishOnly":"bun run build","commit":"cz","format":"prettier -w .","lint":"bunx eslint . --ext ts,tsx,js,jsx","lint:fix":"bunx eslint . --ext ts,tsx,js,jsx --fix"},"devDependencies":{"@eslint/js":"^9.25.1","@trivago/prettier-plugin-sort-imports":"^5.2.2","bun-types":"latest","commitizen":"^4.3.1","commitlint":"^20.1.0","commitlint-config-gitmoji":"^2.3.1","cz-customizable":"^7.5.1","eslint":"^9.25.1","eslint-plugin-react-hooks":"^5.2.0","globals":"^16.0.0","husky":"^9.1.7","lint-staged":"^16.2.4","next":"^15.3.2","prettier":"^3.6.2","react":"^19.1.0","react-dom":"^19.1.0","react-router-dom":"^6.26.2","typescript":"^5.6.3","typescript-eslint":"^8.31.0"},"dependencies":{"@cantabile/date-helper":"latest","axios":"^1.6.7"},"peerDependencies":{"react":"^18.2.0 || ^19.0.0","react-dom":"^18.2.0 || ^19.0.0","react-router-dom":"^6.26.0","next":"^13.4.0 || ^14.0.0 || ^15.0.0"},"peerDependenciesMeta":{"react-router-dom":{"optional":true},"next":{"optional":true}},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"./cz.config.cjs"}},"lint-staged":{"*.{js,ts,jsx,tsx,json,css,md}":["prettier --write","git add"]},"engines":{"node":">=18","bun":">=1.3.0"},"_id":"@cantabile/hooks@1.2.1","gitHead":"56513c95214128ea3400f199227047c04a8dd26d","_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-bOBWr1duZH/YUGT25db3mWialnUnxpIO7dK28D/yK8eKBWnmSu0AfvjHkZam6kJQcTSnd8LYInClHLiGjjUMMA==","shasum":"0ccfbbf1df7b6eb2a4521e21562e1114db8187ed","tarball":"https://registry.npmjs.org/@cantabile/hooks/-/hooks-1.2.1.tgz","fileCount":38,"unpackedSize":50475,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDJ4RQzz6Rmfchk6yvVklrCGeLh+7cVzw9Zth3bIY9cugIgNGOeVSa9u3ds5V6ZQ9u8n7h5lkdR+rXpfEQpIxiQxn8="}]},"_npmUser":{"name":"cantabile","email":"champbassist159@gmail.com"},"directories":{},"maintainers":[{"name":"cantabile","email":"champbassist159@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hooks_1.2.1_1760709265391_0.7162387596108601"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-08T12:09:48.725Z","modified":"2025-10-17T13:54:25.768Z","1.0.0":"2024-02-08T12:09:48.983Z","1.0.1":"2024-02-08T12:12:26.820Z","1.1.0":"2024-02-13T19:41:18.541Z","1.1.1":"2024-02-13T19:49:15.853Z","1.1.2":"2024-02-13T19:51:44.435Z","1.1.3":"2024-12-03T07:54:03.283Z","1.2.0":"2025-10-17T11:50:30.221Z","1.2.1":"2025-10-17T13:54:25.565Z"},"bugs":{"url":"https://github.com/ChampClarinet/hooks/issues"},"author":{"name":"Wallop Opasakhun","url":"https://github.com/champclarinet"},"license":"ISC","homepage":"https://github.com/ChampClarinet/hooks#readme","repository":{"type":"git","url":"git+https://github.com/ChampClarinet/hooks.git"},"description":"React hooks snippets for modern React (18 & 19)","maintainers":[{"name":"cantabile","email":"champbassist159@gmail.com"}],"readme":"# @cantabile/hooks\n\nA modern, framework-friendly collection of **TypeScript React hooks** — built for React 18 & 19, fully compatible with both **React Router** and **Next.js App Router**.\n\nLightweight • Typed • Bun-optimized ⚡\n\n---\n\n## 📦 Installation\n\nYou can install with your preferred package manager:\n\n```bash\n# npm\nnpm install @cantabile/hooks\n\n# yarn\nyarn add @cantabile/hooks\n\n# bun\nbun add @cantabile/hooks\n```\n\n---\n\n## 🪄 Core Hooks\n\n| Hook                               | Description                                                         |\n| ---------------------------------- | ------------------------------------------------------------------- |\n| `useClock()`                       | Returns the current `Date` object and updates every second.         |\n| `useDebounce(handler, delay?)`     | Delays execution of a function until after a given delay.           |\n| `useImage({ src })`                | Fetches an image from a URL and returns a blob URL.                 |\n| `useOutsideAlerter(ref, handler?)` | Detects clicks outside a specified element and triggers a callback. |\n| `useWindowSize()`                  | Returns `[width, height]` of the viewport and updates on resize.    |\n| `useBreakpoint(breakpoint)`        | Returns `true` if width < breakpoint.                               |\n| `useElementSize(ref)`              | Returns `[width, height]` of an element and updates on resize.      |\n| `useReMountComponent(threshold?)`  | Remounts component periodically (default 30s) when window blurs.    |\n| `useOrientation()`                 | Returns device orientation (`\"portrait\"` or `\"landscape\"`).         |\n| `useModalState(initial?)`          | Returns `{ state, open, close, toggle }` for modal management.      |\n\n---\n\n## 🌐 URL Hooks\n\nThis package supports both **React Router** and **Next.js** with separate entrypoints:\n\n### React Router\n\n```ts\nimport { useQueryParams, useSetQueryParams } from \"@cantabile/hooks/url-react\";\n\nconst query = useQueryParams([\"page\", \"search\"]);\nconst setQuery = useSetQueryParams();\n\nsetQuery(\"page\", \"2\");\n```\n\n### Next.js (App Router)\n\n```ts\nimport { useQueryParams, useSetQueryParams } from \"@cantabile/hooks/url-next-app\";\n\nconst query = useQueryParams([\"tab\"]);\nconst setQuery = useSetQueryParams();\n\nsetQuery(\"tab\", \"settings\");\n```\n\n---\n\n## ⚙️ Utility\n\n| Hook / Function   | Description                                |\n| ----------------- | ------------------------------------------ |\n| `wait(ms?)`       | Promise-based delay helper for async flow. |\n| `useModalState()` | Reusable modal visibility state manager.   |\n\n---\n\n## 🧩 Framework Compatibility\n\n| Framework    | Supported Versions |\n| ------------ | ------------------ |\n| React        | 18.x, 19.x         |\n| React Router | 6.26+              |\n| Next.js      | 13.4+, 14.x, 15.x  |\n\n---\n\n## 🧠 Example Usage\n\n```ts\nimport { useClock, useBreakpoint } from \"@cantabile/hooks\";\n\nexport function DashboardHeader() {\n  const now = useClock();\n  const isMobile = useBreakpoint(768);\n\n  return (\n    <header>\n      <p>{now.toLocaleTimeString()}</p>\n      {isMobile && <p>📱 Mobile layout</p>}\n    </header>\n  );\n}\n\n```\n\n---\n\n## 🧱 Build & Development\n\n```bash\nbun run build\nbun run lint\nbun test\n```\n\nUses **Bun 1.3+**, **TypeScript 5.6+**, and **ESM + CJS dual build**.\n\n---\n\n## 🪪 License\n\nLicensed under the **MIT License**.\n© 2025 [Wallop Opasakhun (ChampClarinet)](https://github.com/champclarinet)\n","readmeFilename":"README.md"}