{"_id":"@biks2013/github-asset-client","_rev":"3-4a3d4e9f19690eba0053d7d2edb07c3c","name":"@biks2013/github-asset-client","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@biks2013/github-asset-client","version":"1.0.0","license":"MIT","_id":"@biks2013/github-asset-client@1.0.0","maintainers":[{"name":"giorgos-marinos","email":"giorgos.marinos@gmail.com"}],"dist":{"shasum":"6c1174b849bace1c32edb78a1657f735ae2ebd82","tarball":"https://registry.npmjs.org/@biks2013/github-asset-client/-/github-asset-client-1.0.0.tgz","fileCount":15,"integrity":"sha512-t4sfFzqnnzQpisv4XeI0vLs9XTqaqoyQXxepysMsfuLmqfLcfssn9U7VasEcRhaGWGhmL7FRt59J4be2MKUbeQ==","signatures":[{"sig":"MEQCIFesTYiRugjhYvOGNUyWv+KTGR3PZfcmK/pB5mCiVs0YAiBmoyXBEvt/mE6hf8uwpXi+CPJnTj94T6QRi3MsByXY2A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50567},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"8c424647d7f1e6bbd6d881bb419c11ba455d1176","scripts":{"lint":"eslint . --ext .ts","test":"jest","build":"tsc -p tsconfig.json","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit"},"_npmUser":{"name":"giorgos-marinos","actor":{"name":"giorgos-marinos","type":"user","email":"giorgos.marinos@gmail.com"},"email":"giorgos.marinos@gmail.com"},"_npmVersion":"10.9.2","description":"GitHub asset retrieval client with caching and retry logic","directories":{},"_nodeVersion":"23.5.0","dependencies":{"axios":"^1.6.8","p-retry":"^6.2.0","lru-cache":"^10.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.4.3","@types/jest":"^29.5.12","@types/node":"^20.11.30"},"peerDependencies":{"@types/node":">=18"},"_npmOperationalInternal":{"tmp":"tmp/github-asset-client_1.0.0_1750872949055_0.1902093297584211","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@biks2013/github-asset-client","version":"1.0.1","license":"MIT","_id":"@biks2013/github-asset-client@1.0.1","maintainers":[{"name":"giorgos-marinos","email":"giorgos.marinos@gmail.com"}],"dist":{"shasum":"abbf5050a0ce9d6d9af86ff330679812bf30c0b7","tarball":"https://registry.npmjs.org/@biks2013/github-asset-client/-/github-asset-client-1.0.1.tgz","fileCount":11,"integrity":"sha512-5dYd365tRsPtB3XPwu8Y3+ky+AB6lsl1CjMzTSJkhQAiG8jIvCTE9xlVc65nkV3scc00Xxm9LIEk5RKMtLQ6Bw==","signatures":[{"sig":"MEUCIQDhJvDiuY091LA9L0FSVkE6EkmhjGMGIZ6aoM9zD5ZVOwIgFWJV2n79XT3MsdaPM+/1I27lBVtQCML9dGeoejuRAoM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47423},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"3849a10639eca910d3cb0ef9ccfd8ab8a3374757","scripts":{"lint":"eslint . --ext .ts","test":"jest","build":"tsc -p tsconfig.json","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit"},"_npmUser":{"name":"giorgos-marinos","actor":{"name":"giorgos-marinos","type":"user","email":"giorgos.marinos@gmail.com"},"email":"giorgos.marinos@gmail.com"},"_npmVersion":"10.9.2","description":"GitHub asset retrieval client with caching and retry logic","directories":{},"_nodeVersion":"23.11.0","dependencies":{"axios":"^1.6.8","p-retry":"^6.2.0","lru-cache":"^10.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.4.3","@types/jest":"^29.5.12","@types/node":"^20.11.30"},"peerDependencies":{"@types/node":">=18"},"_npmOperationalInternal":{"tmp":"tmp/github-asset-client_1.0.1_1750925622403_0.18175489727520455","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@biks2013/github-asset-client","version":"1.0.2","description":"GitHub asset retrieval client with caching and retry logic","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","test":"jest","lint":"eslint . --ext .ts","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit"},"dependencies":{"axios":"^1.6.8","lru-cache":"^10.2.0","p-retry":"^6.2.0"},"devDependencies":{"@types/jest":"^29.5.12","@types/node":"^20.11.30","jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.4.3"},"peerDependencies":{"@types/node":">=18"},"publishConfig":{"access":"public"},"license":"MIT","_id":"@biks2013/github-asset-client@1.0.2","gitHead":"f5600780d833f3038dbf0cbd5f11f2bfd6e962fb","_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-OvkGOJxzArG8RJLTAXrIdnjOcXglgA042mpysG7UwvBqgcrpuFP0b/aZbrzfR4Myeu+Y/O1FJnszE2h5Mgfu6w==","shasum":"b93c285a8c39169ce5cbbcaf59bba5f506e3389a","tarball":"https://registry.npmjs.org/@biks2013/github-asset-client/-/github-asset-client-1.0.2.tgz","fileCount":11,"unpackedSize":47423,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEpBhzexb84pOl3Mr1We+WnpgiedHMbB3mi3JXu012RlAiAcw3RSrx4O8n/vi/WB+Rvsc69L9npWsDSkffc/YsMelw=="}]},"_npmUser":{"name":"giorgos-marinos","email":"giorgos.marinos@gmail.com"},"directories":{},"maintainers":[{"name":"giorgos-marinos","email":"giorgos.marinos@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/github-asset-client_1.0.2_1752189090661_0.3424266829554172"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-25T17:35:48.977Z","modified":"2025-07-10T23:11:31.046Z","1.0.0":"2025-06-25T17:35:49.247Z","1.0.1":"2025-06-26T08:13:42.596Z","1.0.2":"2025-07-10T23:11:30.844Z"},"license":"MIT","description":"GitHub asset retrieval client with caching and retry logic","maintainers":[{"name":"giorgos-marinos","email":"giorgos.marinos@gmail.com"}],"readme":"# @biks2013/github-asset-client\n\nGitHub asset retrieval client with caching and retry logic for configuration management.\n\n## Installation\n\n```bash\nnpm install @biks2013/github-asset-client\n```\n\n## Features\n\n- 🔐 GitHub API authentication\n- 💾 In-memory caching with configurable TTL\n- 🔁 Automatic retry with exponential backoff\n- 📁 Directory listing and file retrieval\n- 🔍 Repository search functionality\n- ⚡ Rate limit management\n\n## Usage\n\n```typescript\nimport { GitHubAssetClient } from '@biks2013/github-asset-client';\n\nconst client = new GitHubAssetClient({\n  repo: 'myorg/config-repo',\n  token: process.env.GITHUB_TOKEN!,\n  branch: 'main',\n  cacheEnabled: true,\n  cacheTTL: 300000, // 5 minutes\n  retryOptions: {\n    retries: 3,\n    factor: 2,\n    minTimeout: 1000,\n    maxTimeout: 60000,\n  },\n});\n\n// Get a single file\nconst asset = await client.getAsset('config/app.yaml');\nconsole.log(asset.content);\n\n// List directory contents\nconst files = await client.listAssets('config');\n\n// Search for files\nconst results = await client.searchAssets('database config');\n\n// Clear cache\nclient.clearCache();\n```\n\n## API\n\n### Constructor Options\n\n```typescript\ninterface GitHubAssetClientOptions {\n  repo: string;              // Repository in 'owner/repo' format\n  token: string;             // GitHub personal access token\n  branch?: string;           // Branch name (default: 'main')\n  cacheEnabled?: boolean;    // Enable caching (default: true)\n  cacheTTL?: number;         // Cache TTL in ms (default: 300000)\n  retryOptions?: {           // Retry configuration\n    retries?: number;        // Max retry attempts (default: 3)\n    factor?: number;         // Exponential factor (default: 2)\n    minTimeout?: number;     // Min delay in ms (default: 1000)\n    maxTimeout?: number;     // Max delay in ms (default: 60000)\n    randomize?: boolean;     // Randomize delays (default: true)\n  };\n}\n```\n\n### Methods\n\n#### `getAsset(path: string): Promise<AssetResponse>`\n\nRetrieves a single file from the repository.\n\n#### `listAssets(directory?: string): Promise<GitHubDirectoryItem[]>`\n\nLists all files and directories in the specified path.\n\n#### `searchAssets(query: string): Promise<SearchResult[]>`\n\nSearches for files matching the query string.\n\n#### `clearCache(): void`\n\nClears the in-memory cache.\n\n## Error Handling\n\nThe client provides detailed error messages for common scenarios:\n\n- **404 Not Found**: File or directory doesn't exist\n- **401 Unauthorized**: Invalid authentication token\n- **403 Forbidden**: Rate limit exceeded or insufficient permissions\n- **Network errors**: Connection timeouts or failures\n\n## License\n\nMIT","readmeFilename":"README.md"}