{"_id":"@cfbl/hikaru-sdk","name":"@cfbl/hikaru-sdk","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@cfbl/hikaru-sdk","version":"0.2.0","description":"Fast, privacy-first client-side image optimization SDK","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","types":"./dist/index.d.ts"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts --clean"},"keywords":["image","compression","client-side","browser","privacy"],"author":{"name":"Hikaru Labs"},"license":"MIT","devDependencies":{"tsup":"^8.0.0","typescript":"^5.0.0"},"_id":"@cfbl/hikaru-sdk@0.2.0","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-ODynZj1DyfZFyJAB5A4jbsv0XsQEZ0c63A1xYt3KBPG00/JzUD8KM9tIADMLTwmkLYEWXzQUxbX8Sim/xg6/Cw==","shasum":"06608d7a691398db916d0410b46ac60b5c4169c6","tarball":"https://registry.npmjs.org/@cfbl/hikaru-sdk/-/hikaru-sdk-0.2.0.tgz","fileCount":4,"unpackedSize":12766,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIA10csrzi+7rjX47zBQfsEhJWt0lUR+Oa0D/xlItZAS2AiA2XILRhlzNffjNx5ah0W0QP2DVhWhwHf/CYVOhavdb2A=="}]},"_npmUser":{"name":"cfbl","email":"eloroindia@gmail.com"},"directories":{},"maintainers":[{"name":"cfbl","email":"eloroindia@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hikaru-sdk_0.2.0_1788189694873_0.585505621570227"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-31T15:21:34.663Z","0.2.0":"2026-08-31T15:21:34.989Z","modified":"2026-08-31T15:21:35.250Z"},"maintainers":[{"name":"cfbl","email":"eloroindia@gmail.com"}],"description":"Fast, privacy-first client-side image optimization SDK","keywords":["image","compression","client-side","browser","privacy"],"author":{"name":"Hikaru Labs"},"license":"MIT","readme":"<div align=\"center\">\r\n  \r\n  # 🌌 Hikaru SDK\r\n  \r\n  **Fast, privacy-first client-side image optimization for modern web apps.**\r\n  \r\n  [![npm version](https://img.shields.io/npm/v/@hikarulabs/image-sdk.svg?style=flat-square&color=007acc)](https://www.npmjs.com/package/@hikarulabs/image-sdk)\r\n  [![license](https://img.shields.io/npm/l/@hikarulabs/image-sdk.svg?style=flat-square&color=success)](https://github.com/hikarulabs/image-sdk/blob/main/LICENSE)\r\n  [![bundle size](https://img.shields.io/bundlephobia/minzip/@hikarulabs/image-sdk?style=flat-square&color=ff4e50&label=size)](https://bundlephobia.com/package/@hikarulabs/image-sdk)\r\n\r\n  <br />\r\n</div>\r\n\r\nCompress images **before** they leave the user's device. Save server bandwidth, cut storage costs, and protect user privacy instantly.\r\n\r\n---\r\n\r\n## ✨ The Magic Inside\r\n\r\n* 🔒 **100% Client-Side:** Processing happens entirely in the browser. No servers required.\r\n* 🧹 **Auto EXIF Stripping:** Automatically removes GPS coords, device models, and camera data.\r\n* ⚡ **Hardware Accelerated:** Uses `OffscreenCanvas` & `createImageBitmap` off the main UI thread.\r\n* 📦 **Tiny Footprint:** Zero dependencies. Extremely lightweight.\r\n\r\n## 🚀 Installation\r\n\r\n```bash\r\nnpm install @hikarulabs/image-sdk\r\n💻 Developer Playground\r\nWe designed the API to be as simple or as powerful as you need it to be.\r\n\r\n1. The \"Zero Config\" One-Liner\r\nAutomatically scales down massive phone photos to a web-safe size (max 1920px) at 80% quality.\r\n\r\nTypeScript\r\nimport { compress } from \"@hikarulabs/image-sdk\";\r\n\r\nconst optimized = await compress(file);\r\n2. The \"Preset\" Shorthand\r\nStandardizing user uploads? Just pass a preset string. Available presets: 'avatar', 'thumbnail', 'feed', 'hero'.\r\n\r\nTypeScript\r\nconst avatar = await compress(file, \"avatar\"); \r\n3. The \"Batch\" Uploader\r\nPass an array of files, and we'll process them sequentially to prevent browser memory crashes, complete with a progress hook.\r\n\r\nTypeScript\r\nconst results = await compress(\r\n  [file1, file2, file3], \r\n  \"feed\", \r\n  (completed, total, currentFile) => {\r\n    console.log(`✅ Processed ${completed}/${total}: ${currentFile.name}`);\r\n  }\r\n);\r\n4. The \"Exact Control\" Object\r\nNeed exact pixel dimensions or to force a modern format like WebP?\r\n\r\nTypeScript\r\nconst custom = await compress(file, {\r\n  width: 800,           // Auto-calculates proportional height\r\n  quality: 0.75,        // 75% quality\r\n  format: \"webp\",       // Convert to WebP\r\n  keepOriginalIfSmaller: true // Safety guard!\r\n});\r\n🛠 Advanced API Reference\r\nTypeScript\r\ninterface CompressOptions {\r\n  preset?: \"auto\" | \"avatar\" | \"thumbnail\" | \"feed\" | \"hero\";\r\n  quality?: number;      // 0.1 to 1.0\r\n  width?: number;        // Exact width in px\r\n  height?: number;       // Exact height in px\r\n  maxWidth?: number;     // Scale down if width exceeds this\r\n  maxHeight?: number;    // Scale down if height exceeds this\r\n  format?: \"jpeg\" | \"jpg\" | \"webp\" | \"png\";\r\n  keepOriginalIfSmaller?: boolean; // Default: true\r\n}","readmeFilename":"README.md","_rev":"1-9d6811d74c301c8c9285a8ca14993435"}