{"_rev":"54-dfb99938520301eb0bc186092a7a04bd","time":{"created":"2026-01-05T11:47:30.971Z","modified":"2026-01-05T11:47:31.440Z","1.0.0":"2025-11-04T12:04:40.262Z","1.0.2":"2025-11-04T12:27:01.450Z","1.0.3":"2025-11-04T12:50:50.012Z","1.0.4":"2025-11-05T08:11:42.088Z","1.0.5":"2025-11-06T14:24:22.679Z","1.0.6":"2025-11-07T05:00:26.024Z","1.0.7":"2025-11-07T05:37:13.249Z","1.0.8":"2025-11-08T05:26:46.651Z","1.0.9":"2025-11-08T07:35:08.079Z","1.1.0":"2025-11-08T07:51:30.503Z","1.1.1":"2025-11-08T12:06:18.617Z","1.1.2":"2025-11-08T15:56:08.411Z","1.1.3":"2025-11-09T10:33:28.929Z","1.1.5":"2025-11-09T11:08:31.618Z","1.1.7":"2025-11-09T11:11:40.974Z","1.1.8":"2025-11-09T11:14:25.083Z","1.1.9":"2025-11-09T12:48:12.177Z","1.2.0":"2025-11-09T13:26:47.387Z","1.2.1":"2025-11-10T05:32:10.310Z","1.2.2":"2025-11-10T05:55:43.239Z","1.2.3":"2025-11-11T02:50:09.775Z","1.2.4":"2025-11-18T06:51:11.050Z","2.0.0":"2025-12-06T13:31:07.761Z","2.1.0":"2025-12-06T16:07:21.449Z","2.2.0":"2025-12-07T07:12:02.521Z","2.3.0":"2025-12-07T14:40:06.156Z","2.3.5":"2025-12-07T18:36:21.092Z","2.4.0":"2025-12-09T16:09:00.995Z","2.4.5":"2025-12-09T16:15:34.436Z","2.4.7":"2025-12-09T16:20:10.899Z","2.5.0":"2025-12-09T16:21:18.060Z","2.6.0":"2025-12-13T02:04:33.790Z","2.6.5":"2025-12-16T00:11:27.099Z","2.7.0":"2025-12-16T00:12:13.298Z","2.7.1":"2025-12-16T03:50:09.967Z","2.7.2":"2025-12-16T04:25:01.306Z","2.8.0":"2025-12-16T05:49:13.209Z","2.8.1":"2025-12-16T05:53:01.357Z","2.8.2":"2025-12-16T06:00:52.396Z","2.8.3":"2025-12-16T06:09:14.168Z","2.8.5":"2025-12-19T21:23:04.042Z","2.8.6":"2025-12-20T05:35:27.255Z","2.8.7":"2025-12-20T20:16:35.315Z","2.9.0":"2025-12-20T20:36:05.208Z","2.9.1":"2025-12-20T20:39:15.555Z","2.9.2":"2025-12-20T20:42:18.054Z","2.9.3":"2025-12-20T20:47:43.759Z","2.9.4":"2025-12-20T21:11:29.402Z","3.0.0":"2025-12-21T06:17:21.134Z","3.2.0":"2026-01-05T11:47:31.144Z"},"_id":"gdrivekit","name":"gdrivekit","dist-tags":{"latest":"3.2.0"},"versions":{"3.2.0":{"name":"gdrivekit","version":"3.2.0","description":"A lightweight Google Drive toolkit for effortless file management — handle uploads, downloads, and Drive operations in just a few lines of code.","type":"module","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"dev":"bun run index.ts","build":"bun build ./index.ts --outdir dist --target node","types":"tsc --emitDeclarationOnly --outDir dist","prepare":"bun run types && bun run build","prepublishOnly":"bun run prepare"},"keywords":["google-drive","google drive","googledrive","gdrive","drive-api","googleapis","google drive api","google drive oauth2","google drive upload","google drive automation","gdrivekit"],"author":{"name":"VK","url":"https://github.com/vk007"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/vk007/gdrivekit.git"},"homepage":"https://www.npmjs.com/package/gdrivekit","bugs":{"url":"https://github.com/vk007/gdrivekit/issues"},"dependencies":{"archiver":"^7.0.1","archiver-zip-encrypted":"^2.0.0","core-util-is":"^1.0.3","crypto":"^1.0.1","update-notifier":"^7.3.1"},"devDependencies":{"@types/node":"latest","@types/archiver":"^7.0.0","@types/update-notifier":"^6.0.8","typescript":"^5.6.3"},"engines":{"node":">=18.0.0","bun":">=1.1.0"},"gitHead":"42e4d191a7eccaf30c9f5f83958bf570d56f379e","_id":"gdrivekit@3.2.0","_nodeVersion":"24.10.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-1IdVBSy5WXFPOE6i4R9rPE7xxYxGwftlxFEP+acv7rnL3f064bwUS26SsnIN8HsKzCnUbL+1PG/sl2cghX+VaQ==","shasum":"3aa5ca3d400e6d34c41a06a93617476f406b29f4","tarball":"https://registry.npmjs.org/gdrivekit/-/gdrivekit-3.2.0.tgz","fileCount":121,"unpackedSize":1325811,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIH2tg/W2XihQhh+KflI4AL8lehsuuFdzyjGycqXYTZJZAiEAoyA9NoE9vU1m9ZWAn+CswCd0Lc9F0TTgtX0tVq2tF9Q="}]},"_npmUser":{"name":"vk007","email":"vikashkhati007@gmail.com"},"directories":{},"maintainers":[{"name":"vk007","email":"vikashkhati007@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gdrivekit_3.2.0_1767613650972_0.9890770679258214"},"_hasShrinkwrap":false}},"maintainers":[{"name":"vk007","email":"vikashkhati007@gmail.com"}],"description":"A lightweight Google Drive toolkit for effortless file management — handle uploads, downloads, and Drive operations in just a few lines of code.","homepage":"https://www.npmjs.com/package/gdrivekit","keywords":["google-drive","google drive","googledrive","gdrive","drive-api","googleapis","google drive api","google drive oauth2","google drive upload","google drive automation","gdrivekit"],"repository":{"type":"git","url":"git+https://github.com/vk007/gdrivekit.git"},"author":{"name":"VK","url":"https://github.com/vk007"},"bugs":{"url":"https://github.com/vk007/gdrivekit/issues"},"license":"MIT","readme":"## 🧩 gdrivekit\n\n> **Google Drive file automation in just a few lines of code.**\n> Perform uploads, downloads, folder management, and advanced search operations effortlessly using TypeScript or Node.js.\n\n---\n\n### 🚀 Features\n\n- 📂 Upload, download, and manage Google Drive files\n- 🗂️ Create and organize folders\n- 🔍 Powerful search and filter utilities\n- ⚙️ Batch file operations\n- ⚡ **Lazy Loading Architecture:** Functions are loaded only when needed.\n- 💡 Works with Node.js and Bun\n\n---\n\n### 📦 Installation\n\n```bash\nnpm install gdrivekit\n```\n\nor\n\n```bash\nbun add gdrivekit\n```\n\n---\n\n### 💻 Example Usage\n\n### ⚙️ One-Time Setup (Token Generation)\n\nBefore you can use Google Drive operations, you must generate **access and refresh tokens**.\nThis only needs to be done **once**.\n\n```ts\nimport { generateCredentialsAndTokens } from \"gdrivekit\";\n\nawait generateCredentialsAndTokens({\n  clientid: process.env.GOOGLE_CLIENT_ID!,\n  projectid: process.env.GOOGLE_PROJECT_ID!,\n  clientsecret: process.env.GOOGLE_CLIENT_SECRET!,\n  redirecturis: [\"http://localhost:3000/oauth2callback\"],\n  javascript_origin: [\"http://localhost:3000\"],\n});\n```\n\n---\n\n# 🔄 Initializing the Drive Service\n\nInitialize the service and access operations through categorized groups:\n\n```ts\nimport { initDriveService, operations } from \"gdrivekit\";\n\nasync function main() {\n  initDriveService();\n\n  // Example: Search files by name using searchOperations\n  const files = await operations.searchOperations.searchByName(\"test\");\n  console.log(files.data?.files);\n\n  // Example: Get Folder ID by Name using folderOperations\n  const folder = await operations.folderOperations.getFolderIdByName(\n    \"My Documents\"\n  );\n  console.log(folder);\n\n  // Example: List all folders using listOperations\n  const allFolders = await operations.listOperations.listAllFolders();\n  console.log(allFolders);\n}\n\nmain();\n```\n\n---\n\n## 🧠 Available Operations\n\nAll operations are grouped by category under the main `operations` object.\n\n### 📁 **`operations.fileOperations`**\n\n| Method                  | Description                                     |\n| ----------------------- | ----------------------------------------------- |\n| `readFileData()`        | Read file content                               |\n| `uploadFile()`          | Upload a new file to Google Drive               |\n| `downloadFile()`        | Download a file from Drive                      |\n| `deleteFile()`          | Permanently delete a file                       |\n| `renameFile()`          | Rename an existing file                         |\n| `updateFile()`          | Update file metadata or content                 |\n| `getFileInfo()`         | Get details of a specific file                  |\n| `getFileIdByName()`     | Fetch file ID by its name (Exact Match)         |\n| `getCompleteFileInfo()` | Get complete file metadata including all fields |\n| `moveFile()`            | Move file to another folder using file ID       |\n| `copyFile()`            | Make a copy of a file in Drive                  |\n| `getImageMetadata()`    | Get image metadata (EXIF data, dimensions)      |\n| `getVideoMetadata()`    | Get video metadata (duration, dimensions)       |\n\n---\n\n### 🗂️ **`operations.folderOperations`**\n\n| Method                | Description                               |\n| --------------------- | ----------------------------------------- |\n| `createFolder()`      | Create a new folder                       |\n| `deleteFolder()`      | Delete an existing folder                 |\n| `renameFolder()`      | Rename an existing folder                 |\n| `getFolderIdByName()` | Fetch folder ID by its name (Exact Match) |\n\n---\n\n### 🔍 **`operations.searchOperations`**\n\n| Method                  | Description                            |\n| ----------------------- | -------------------------------------- |\n| `searchByName()`        | Search files containing a name         |\n| `searchByExactName()`   | Search files matching exact name       |\n| `searchByType()`        | Search by file type (e.g., PDF, image) |\n| `searchModifiedAfter()` | Find files modified after a given date |\n| `searchStarredFiles()`  | List all starred files                 |\n| `searchSharedFiles()`   | Find files shared with you             |\n| `searchByContent()`     | Search within file content             |\n\n---\n\n### 📋 **`operations.listOperations`**\n\n| Method                  | Description                               |\n| ----------------------- | ----------------------------------------- |\n| `listFiles()`           | List all files in Drive                   |\n| `listRecentFiles()`     | List recently modified or added files     |\n| `listFoldersByName()`   | List all folders with a specific name     |\n| `listAllFolders()`      | List all folders in Drive                 |\n| `listFilesInFolder()`   | List all files within a specific folder   |\n| `listFoldersInFolder()` | List all folders within a specific folder |\n| `listPDFs()`            | List all PDF files                        |\n| `listImages()`          | List all image files                      |\n| `listVideos()`          | List all video files                      |\n| `listAudios()`          | List all audio files                      |\n| `listArchives()`        | List all archive files                    |\n| `listJSONs()`           | List all json files                       |\n| `listSheets()`          | List all sheet files                      |\n| `listPresentations()`   | List all presentation files               |\n| `listDocs()`            | List all docs files                       |\n\n---\n\n### 🧩 **`operations.batchOperations`**\n\n| Method                    | Description                          |\n| ------------------------- | ------------------------------------ |\n| `uploadMultipleFiles()`   | Upload multiple files at once        |\n| `deleteMultipleFiles()`   | Delete multiple files simultaneously |\n| `downloadMultipleFiles()` | Download multiple files in parallel  |\n\n---\n\n### 🧰 **`operations.utilityOperations`**\n\n| Method                           | Description                                               |\n| -------------------------------- | --------------------------------------------------------- |\n| `encryptText()`                  | Encrypt plain text using AES-256-GCM                      |\n| `decryptText()`                  | Decrypt encrypted text using AES-256-GCM                  |\n| `filesAndFoldersToZip()`         | Create a zip archive of folder and multiple files         |\n| `findDuplicateFilesAndFolders()` | Find duplicate file and folder names in Drive             |\n| `getFileTypeBreakdown()`         | Get folder type breakdown in a parent folder              |\n| `getAllFilesInParent()`          | Get all files in a parent folder not including subfolders |\n| `shareFile()`                    | Share a file with a user                                  |\n| `fileExists()`                   | Check if a file exists                                    |\n| `getStorageQuota()`              | Get storage quota information                             |\n| `createStream()`                 | Create stream for any Google Drive file                   |\n\n---\n\n### ❴❵ **`operations.jsonOperations`**\n\n| Method                       | Description                             |\n| ---------------------------- | --------------------------------------- |\n| `createJsonFile()`           | Create a new JSON file                  |\n| `readJsonFileData()`         | Read JSON file content                  |\n| `addJsonKeyValue()`          | Add a new key-value pair to a JSON file |\n| `pushJsonObjectToArray()`    | Push a new object to a JSON array field |\n| `updateJsonFieldAndValues()` | Update an existing field in a JSON file |\n| `selectJsonContent()`        | Select content from a JSON file         |\n| `deleteJsonFieldAndKeys()`   | Delete a field from a JSON file         |\n\n---\n\n### ⚞ **`operations.conversionOperations`**\n\n| Method                  | Description                                |\n| ----------------------- | ------------------------------------------ |\n| `convertTextToDocs()`   | Convert a text file to Google Docs format  |\n| `convertDocsToPdf()`    | Convert a Google Docs file to PDF          |\n| `convertDocsToWord()`   | Convert a Google Docs file to Word         |\n| `convertDocsToText()`   | Convert a Google Docs file to plain text   |\n| `convertCsvToSheet()`   | Convert a CSV file to Google Sheets        |\n| `convertExcelToSheet()` | Convert an Excel file to Google Sheets     |\n| `convertSheetToCsv()`   | Convert a Google Sheet to CSV              |\n| `convertSheetToPdf()`   | Convert a Google Sheet to PDF              |\n| `convertPptToSlides()`  | Convert a PowerPoint file to Google Slides |\n| `convertSlidesToPpt()`  | Convert a Google Slides file to PowerPoint |\n| `convertSlidesToPdf()`  | Convert a Google Slides file to PDF        |\n| `convertPdfToDocs()`    | Convert a PDF file to Google Docs (OCR)    |\n| `convertDrawingToPng()` | Convert a Google Drawing to PNG            |\n| `convertDrawingToPdf()` | Convert a Google Drawing to PDF            |\n\n---\n\n### ⚞ **`operations.watcherOperations`**\n\n| Method                   | Description                                                  |\n| ------------------------ | ------------------------------------------------------------ |\n| `watchFolderEvent()`     | Detect add/modify/delete events in a folder (non-recursive). |\n| `watchFolderDeepEvent()` | Detect events recursively in a folder and subfolders.        |\n\n---\n\n### ⚞ **`operations.scriptOperations`**\n\n| Method                 | Description                                     |\n| ---------------------- | ----------------------------------------------- |\n| `createGoogleScript()` | Create a new Google Apps Script project.        |\n| `updateGoogleScript()` | Update code in an existing Apps Script project. |\n| `deleteGoogleScript()` | Move an Apps Script project to trash.           |\n| `deployGoogleScript()` | Deploy a new version of an Apps Script project. |\n\n## 🔑 Enabling Google Apps Script API (Required for Script Tools)\n\n### 1️⃣ Enable Apps Script API in Google Cloud Console\n\nOpen this link (replace YOUR_PROJECT_ID if needed):\n\n👉 https://console.cloud.google.com/apis/library/script.googleapis.com?project=YOUR_PROJECT_ID\n\nThen:\n\n1. Click **Enable**\n2. Make sure the Apps Script API is active in your Cloud project\n\n### 2️⃣ Enable Apps Script API in Your Google Account\n\nApps Script also requires user-level permission.\n\nOpen:\n\n👉 https://script.google.com/home/usersettings\n\nThen turn **ON**:\n\n🔘 “Apps Script API”\n\nThis MUST be enabled or script creation, updating, and deployment will fail.\n\n---\n\n### 🧑‍💻 Author\n\n**VK**\n[GitHub](https://github.com/vk007) • [NPM](https://www.npmjs.com/~vk007)\n\n---\n\n### ⚖️ License\n\n**MIT License** — free to use, modify, and distribute.\n\n---\n","readmeFilename":"README.md"}