{"name":"@google-automations/git-file-utils","version":"3.0.1","keywords":["Git data API"],"author":{"name":"Jeff Ching","email":"chingor@google.com"},"license":"Apache-2.0","_id":"@google-automations/git-file-utils@3.0.1","maintainers":[{"name":"google-wombot","email":"node-team-npm+wombot@google.com"}],"homepage":"https://github.com/googleapis/repo-automation-bots","bugs":{"url":"https://github.com/googleapis/repo-automation-bots/issues"},"dist":{"shasum":"12a3faf521c49f76095529ab0f3b139f9405f468","tarball":"http://registry-npm.ywwl.com/@google-automations/git-file-utils/download/@google-automations/git-file-utils-3.0.1.tgz","fileCount":6,"integrity":"sha512-vlQZ8DlBcippB5zTY0M5Rib8tKT4yQ7oBKbs6kcWAzp70oyillKinXLZwlIgNTmfzzZx1J6cez3M0EmrpXFRcw==","signatures":[{"sig":"MEQCIDFMG4w36h+C25gHsRattK2Gp6wMJoFdLlIscTbR3S3PAiBV28aZE3oVquEt0LyUho4jzemz47Ve4xTRC2QG2TrD0w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46151,"size":10827,"noattachment":false,"key":"/@google-automations/git-file-utils/-/@google-automations/git-file-utils-3.0.1.tgz"},"main":"./build/src/git-file-utils.js","_from":"file:google-automations-git-file-utils-3.0.1.tgz","types":"./build/src/git-file-utils.d.ts","engines":{"node":">= 20"},"scripts":{"fix":"gts fix","lint":"gts check","test":"cross-env NODE_ENV=test LOG_LEVEL=fatal c8 mocha ./build/test","compile":"tsc -p .","prepare":"npm run compile","pretest":"npm run compile","test:snap":"SNAPSHOT_UPDATE=1 npm test","system-test":"npm run pretest && cross-env LOG_LEVEL=fatal mocha ./build/test/integration"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"_resolved":"/b/f/w/src/git/build-dir/packages/git-file-utils/google-automations-git-file-utils-3.0.1.tgz","overrides":{"tmp":"0.2.5"},"_integrity":"sha512-vlQZ8DlBcippB5zTY0M5Rib8tKT4yQ7oBKbs6kcWAzp70oyillKinXLZwlIgNTmfzzZx1J6cez3M0EmrpXFRcw==","repository":{"url":"git+https://github.com/googleapis/repo-automation-bots.git","type":"git"},"_npmVersion":"10.8.2","description":"Utilities for github file operation","directories":{},"_nodeVersion":"18.20.8","dependencies":{"js-yaml":"^4.1.1","minimatch":"^10.2.4","@octokit/rest":"^20.1.1","@octokit/types":"^13.0.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.12.0","gts":"^4.0.0","chai":"^4.3.6","nock":"^13.2.9","mocha":"^10.0.0","sinon":"^15.0.0","dotenv":"^16.0.2","cross-env":"^7.0.3","node-fetch":"^2.7.0","typescript":"^4.9.4","@types/chai":"^4.3.3","@types/node":"^20.0.0","@types/mocha":"^10.0.0","@types/sinon":"^10.0.13","snap-shot-it":"^7.9.6"},"_npmOperationalInternal":{"tmp":"tmp/git-file-utils_3.0.1_1775061019323_0.79317880336552","host":"s3://npm-registry-packages-npm-production"},"readme":"# git-file-utils\n\nThis is a small library for handling git files. Currently it only provides\n`RepositoryFileCache` which is a read-through cache for a single branch. Because\nthis library uses GIt Data API, it can fetch files up to 100 MB of size.\n\n## Install\n\n```bash\nnpm i @google-automations/git-file-utils\n```\n\n## Fetch a file\n\n```typescript\nimport {Octokit} from '@octokit/rest';\nimport {\n  FileNotFoundError,\n  RepositoryFileCache\n} from '@google-automations/git-file-utils';\n\nconst octokit = new Octokit();\nconst cache = new RepositoryFileCache(\n  octokit,\n  {\n    owner: \"googleapis\",\n    repo: \"repo-automation-bots\",\n  });\ntry {\n  const contents = await cache.getFileContents(\"README.md\", \"main\");\n  console.log(`content: ${contents.parsedContent}`);\n} catch (e) {\n  if (e instanceof FileNotFoundError) {\n    console.log(`file not found`);\n  } else {\n    // rethrow\n    throw e;\n  }\n}\n```\n","publish_time":1775061019463,"_cnpm_publish_time":1775061019463,"dist-tags":{"latest":"3.2.1"}}