{"_id":"@ashish-um/nook","_rev":"5-b55d22bf7d0b3cd0f60c2c2c594f326c","name":"@ashish-um/nook","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@ashish-um/nook","version":"1.0.0","keywords":["google-drive","crud","storage","appdata","drive-api"],"author":{"name":"ashish-um"},"license":"MIT","_id":"@ashish-um/nook@1.0.0","maintainers":[{"name":"ashish-um","email":"ashishumrao12345@gmail.com"}],"homepage":"https://github.com/ashish-um/nook#readme","bugs":{"url":"https://github.com/ashish-um/nook/issues"},"dist":{"shasum":"9d65059fe4d03eae4080c2bd7d57968df9d0465c","tarball":"https://registry.npmjs.org/@ashish-um/nook/-/nook-1.0.0.tgz","fileCount":6,"integrity":"sha512-M4+S0E+PkUnwG9QR+oQK+qPi9fMSpzl5F38TPcZOzJ8Y58HbJBC0zL1End2oRKkuKLwqMYBUZiQl7llbYipIEA==","signatures":[{"sig":"MEUCIFP5n5SKOGHh7Vs91ZbHMFMdz00KQFkEH8ywLw72PIdMAiEA6YNKOvEQ7lIxHw94j6utMfX+ZWKopxPsZAakQunmDu8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17044},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"178615f9ca23c1e4f58861f1feba6cb9db7b5013","scripts":{"test":"vitest","build":"tsup"},"_npmUser":{"name":"ashish-um","email":"ashishumrao12345@gmail.com"},"repository":{"url":"git+https://github.com/ashish-um/nook.git","type":"git"},"_npmVersion":"11.12.0","description":"A reusable TypeScript module for using Google Drive as per-user cloud storage","directories":{},"_nodeVersion":"25.8.1","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","dotenv":"^17.4.0","vitest":"^4.1.2","typescript":"^6.0.2","@types/node":"^25.5.2"},"_npmOperationalInternal":{"tmp":"tmp/nook_1.0.0_1775423620458_0.6527285050181839","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@ashish-um/nook","version":"1.0.1","keywords":["google-drive","crud","storage","appdata","drive-api"],"author":{"name":"ashish-um"},"license":"MIT","_id":"@ashish-um/nook@1.0.1","maintainers":[{"name":"ashish-um","email":"ashishumrao12345@gmail.com"}],"homepage":"https://github.com/ashish-um/nook#readme","bugs":{"url":"https://github.com/ashish-um/nook/issues"},"dist":{"shasum":"1912fb70418f373ec26c4d9f6460c92afc598f85","tarball":"https://registry.npmjs.org/@ashish-um/nook/-/nook-1.0.1.tgz","fileCount":7,"integrity":"sha512-4XIMBDAx6Tpee1jcWjpm6gvyKk+RmU2nILSjKWEs3w6aOtSNOIxJqCvMFny93OUm5nu/i4LTxIytfyvpFKLx2w==","signatures":[{"sig":"MEUCIQCYNGO1q3E880lAbS4Ouqn0EJOmj3b9umKuKeaSACo2SwIgQdabvIpiuo+llY6LyRQWHxZGoQOfLNXRz4cFh0d3mEk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18145},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"fa77f8740f190d8f4009ef1b1571b5a40ff9cc3d","scripts":{"test":"vitest","build":"tsup"},"_npmUser":{"name":"ashish-um","email":"ashishumrao12345@gmail.com"},"repository":{"url":"git+https://github.com/ashish-um/nook.git","type":"git"},"_npmVersion":"11.12.0","description":"A reusable TypeScript module for using Google Drive as per-user cloud storage","directories":{},"_nodeVersion":"25.8.1","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","dotenv":"^17.4.0","vitest":"^4.1.2","typescript":"^6.0.2","@types/node":"^25.5.2"},"_npmOperationalInternal":{"tmp":"tmp/nook_1.0.1_1775424066026_0.3386757528503206","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@ashish-um/nook","version":"1.0.2","keywords":["google-drive","crud","storage","appdata","drive-api"],"author":{"name":"ashish-um"},"license":"MIT","_id":"@ashish-um/nook@1.0.2","maintainers":[{"name":"ashish-um","email":"ashishumrao12345@gmail.com"}],"homepage":"https://github.com/ashish-um/nook#readme","bugs":{"url":"https://github.com/ashish-um/nook/issues"},"dist":{"shasum":"9f7d044fab4b405638d880a6cc98fc877fac72bc","tarball":"https://registry.npmjs.org/@ashish-um/nook/-/nook-1.0.2.tgz","fileCount":9,"integrity":"sha512-gh1haECxCdxEUSdi/bBhRpPJJmbmCsDHDONR2nlT++cHbmWr6DtMdNQeBnMwp/qn5C4ow5g3IeCkX2bLdHlgIg==","signatures":[{"sig":"MEQCIChZGjYzIB/wwp91A4WsTC+gPnFuwLXsqylA/w6A2J2JAiBGgrc9Tb1S17WNY6ttNGK6qI2GixtZdBCrBTBi7GvsTQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43596},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"d53512d9f78c0e978ff9c6068bf88b421789384e","scripts":{"test":"vitest","build":"tsup"},"_npmUser":{"name":"ashish-um","email":"ashishumrao12345@gmail.com"},"repository":{"url":"git+https://github.com/ashish-um/nook.git","type":"git"},"_npmVersion":"11.12.0","description":"A reusable TypeScript module for using Google Drive as per-user cloud storage","directories":{},"_nodeVersion":"25.8.1","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","dotenv":"^17.4.0","vitest":"^4.1.2","typescript":"^6.0.2","@types/node":"^25.5.2"},"_npmOperationalInternal":{"tmp":"tmp/nook_1.0.2_1775464555315_0.7680924805772729","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@ashish-um/nook","version":"1.0.3","keywords":["google-drive","crud","storage","appdata","drive-api"],"author":{"name":"ashish-um"},"license":"MIT","_id":"@ashish-um/nook@1.0.3","maintainers":[{"name":"ashish-um","email":"ashishumrao12345@gmail.com"}],"homepage":"https://github.com/ashish-um/nook#readme","bugs":{"url":"https://github.com/ashish-um/nook/issues"},"dist":{"shasum":"1d379f5b7a91703486a1699571cf282c8a96b6c1","tarball":"https://registry.npmjs.org/@ashish-um/nook/-/nook-1.0.3.tgz","fileCount":9,"integrity":"sha512-FXIeg+aflXjxx0ZTG+Y5UXCCk4FzUtfrQreI6BBkGv6fSit+jeW6UuInR2UQHHqVowc29S9qxxs732UJY2UHEA==","signatures":[{"sig":"MEYCIQCWhhsxbJcM6LpfQdb0l9AmGB1ZPfbEUAbAxVfO8Nw1nQIhANDD24ipgV9M9M+qwwznOXomNkweHoAjq+Og2eN++RzZ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43906},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"c7e4271b911e0e9f240dcc53efb33ccd4ef33992","scripts":{"test":"vitest","build":"tsup"},"_npmUser":{"name":"ashish-um","email":"ashishumrao12345@gmail.com"},"repository":{"url":"git+https://github.com/ashish-um/nook.git","type":"git"},"_npmVersion":"11.12.0","description":"A reusable TypeScript module for using Google Drive as per-user cloud storage","directories":{},"_nodeVersion":"25.8.1","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","dotenv":"^17.4.0","vitest":"^4.1.2","typescript":"^6.0.2","@types/node":"^25.5.2"},"_npmOperationalInternal":{"tmp":"tmp/nook_1.0.3_1775464912388_0.41520895520916357","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@ashish-um/nook","version":"1.0.4","description":"A reusable TypeScript module for using Google Drive as per-user cloud storage","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup","test":"vitest"},"keywords":["google-drive","crud","storage","appdata","drive-api"],"author":{"name":"ashish-um"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ashish-um/nook.git"},"devDependencies":{"@types/node":"^25.5.2","dotenv":"^17.4.0","tsup":"^8.5.1","tsx":"^4.21.0","typescript":"^6.0.2","vitest":"^4.1.2"},"gitHead":"7b28dbba9cd1839c244bb6a018401ee85772e8b4","_id":"@ashish-um/nook@1.0.4","bugs":{"url":"https://github.com/ashish-um/nook/issues"},"homepage":"https://github.com/ashish-um/nook#readme","_nodeVersion":"25.8.1","_npmVersion":"11.12.0","dist":{"integrity":"sha512-m5Oj25DjtsV4ACTclsXSpNsus3CXI0MlrIy6DyisTgtZjO2NLtJuN/+rlznAMyoXF/isHYhMIkvNGbLPyqoSWA==","shasum":"60218fd84ea2582ab3f6615f2d074995cec7a61c","tarball":"https://registry.npmjs.org/@ashish-um/nook/-/nook-1.0.4.tgz","fileCount":7,"unpackedSize":18317,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCdq9r4UbJTCtRhb+Rk84Vf93IhgjQkl0BuKjSSVKBB5QIhAM/oftgmKfUi73k810tKQI/e8qqbzD8LatQ2DSj1DIK9"}]},"_npmUser":{"name":"ashish-um","email":"ashishumrao12345@gmail.com"},"directories":{},"maintainers":[{"name":"ashish-um","email":"ashishumrao12345@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nook_1.0.4_1775718644383_0.24140189335950946"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-05T21:13:40.354Z","modified":"2026-04-09T07:10:44.645Z","1.0.0":"2026-04-05T21:13:40.600Z","1.0.1":"2026-04-05T21:21:06.212Z","1.0.2":"2026-04-06T08:35:55.447Z","1.0.3":"2026-04-06T08:41:52.539Z","1.0.4":"2026-04-09T07:10:44.534Z"},"bugs":{"url":"https://github.com/ashish-um/nook/issues"},"author":{"name":"ashish-um"},"license":"MIT","homepage":"https://github.com/ashish-um/nook#readme","keywords":["google-drive","crud","storage","appdata","drive-api"],"repository":{"type":"git","url":"git+https://github.com/ashish-um/nook.git"},"description":"A reusable TypeScript module for using Google Drive as per-user cloud storage","maintainers":[{"name":"ashish-um","email":"ashishumrao12345@gmail.com"}],"readme":"# Nook (DriveCRUD)\n\nA reusable TypeScript module for using Google Drive as per-user cloud storage.\n\n## Install\n\n```\nnpm install @ashish-um/nook\n```\n\n## Quick Start\n\n```typescript\nimport { DriveCRUD } from \"@ashish-um/nook\";\n\nconst drive = new DriveCRUD(googleAccessToken);\n\n// Create\nawait drive.create(\"notes/hello.json\", { title: \"Hello\", body: \"World\" });\n\n// Read\nconst note = await drive.read(\"notes/hello.json\");\n\n// Update\nawait drive.update(\"notes/hello.json\", { title: \"Hello\", body: \"Updated\" });\n\n// List\nconst allNotes = await drive.list(\"notes/\");\n\n// Delete\nawait drive.delete(\"notes/hello.json\");\n```\n\n## Documentation\n\n- **[Full API Documentation](./nook-documentation.md)** — Detailed breakdown of every method, parameters, and error handling.\n- **[React & Next.js Guide](./nook-react-nextjs-guide.md)** — How to cleanly integrate Google Identity Services and DriveCRUD using context providers and hooks.\n\n## API\n\n### `new DriveCRUD(token, options?)`\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `appSpace` | `\"appDataFolder\" \\| \"drive\"` | `\"appDataFolder\"` | Where to store files |\n\n### Methods\n\n| Method | Returns | Description |\n|---|---|---|\n| `create(name, data)` | `Promise<DriveFile>` | Create a new file. Throws `ALREADY_EXISTS` if it exists. |\n| `read(name)` | `Promise<unknown>` | Read and parse file content. Throws `NOT_FOUND`. |\n| `update(name, data)` | `Promise<DriveFile>` | Overwrite existing file. Throws `NOT_FOUND`. |\n| `delete(name)` | `Promise<void>` | Delete a file. Throws `NOT_FOUND`. |\n| `list(prefix?)` | `Promise<DriveFile[]>` | List files, optionally filtered by prefix. |\n| `setToken(token)` | `void` | Replace the stored access token. |\n\n### Error Handling\n\nAll errors are instances of `DriveError` with a typed `code`:\n\n```typescript\nimport { DriveError } from \"@ashish-um/nook\";\n\ntry {\n  await drive.read(\"missing.json\");\n} catch (err) {\n  if (err instanceof DriveError && err.code === \"NOT_FOUND\") {\n    // handle gracefully\n  }\n}\n```\n\nError codes: `NOT_FOUND`, `ALREADY_EXISTS`, `INVALID_TYPE`, `AUTH_ERROR`, `API_ERROR`.\n\n## OAuth2 Scope\n\nYour app must request this scope:\n\n```\nhttps://www.googleapis.com/auth/drive.appdata\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}