{"name":"@google-automations/git-file-utils","version":"1.2.2","description":"Utilities for github file operation","scripts":{"compile":"tsc -p .","pretest":"npm run compile","prepare":"npm run compile","test":"cross-env NODE_ENV=test LOG_LEVEL=fatal c8 mocha ./build/test","test:snap":"SNAPSHOT_UPDATE=1 npm test","system-test":"npm run pretest && cross-env LOG_LEVEL=fatal mocha ./build/test/integration","fix":"gts fix","lint":"gts check"},"main":"./build/src/git-file-utils.js","repository":{"type":"git","url":"git+https://github.com/googleapis/repo-automation-bots.git"},"homepage":"https://github.com/googleapis/repo-automation-bots","bugs":{"url":"https://github.com/googleapis/repo-automation-bots/issues"},"dependencies":{"@octokit/rest":"19.0.5","@octokit/types":"^7.5.1","minimatch":"^5.1.0"},"devDependencies":{"@types/chai":"^4.3.3","@types/minimatch":"^5.1.2","@types/mocha":"^10.0.0","@types/node":"^18.7.15","@types/sinon":"^10.0.13","c8":"^7.12.0","chai":"^4.3.6","cross-env":"^7.0.3","dotenv":"^16.0.2","gts":"^4.0.0","mocha":"^10.0.0","nock":"^13.2.9","sinon":"^14.0.0","snap-shot-it":"^7.9.6","typescript":"~4.8.2"},"engines":{"node":">= 14"},"keywords":["Git data API"],"author":{"name":"Jeff Ching","email":"chingor@google.com"},"license":"Apache-2.0","types":"./build/src/git-file-utils.d.ts","gitHead":"61d8aa8e0636fda69abd24c1ad4ef0573ac2c99a","_id":"@google-automations/git-file-utils@1.2.2","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-UGZypVMDGFJjVCVHI5yqZsqZtaTJoYVyZJ9IJ1sF02Hh0QbDCJHPmPXUpKnPWt9NG51U4ws+K56c1d8s+omvFw==","shasum":"6a70803539923cfbda31a1f9ad5a264f630e2f99","tarball":"http://registry-npm.ywwl.com/@google-automations/git-file-utils/download/@google-automations/git-file-utils-1.2.2.tgz","fileCount":6,"unpackedSize":45357,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHPQMNsuBxTo3peJ7XImiv6W1NgnSeK+K31Xs2ah7g+bAiAtTIDwddQDKGHUmMbK2AFNCewO0HRLnA4FPtq0a/6VUw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYUq8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKLxAAkNdldewfBh82P2VtCDvfQJRz9SEXQC9qNDxec9n0EZKuaNbP\r\nEaAZqTo1m+KqVbk4KEZZ4yk9ALfSlusTAJRWUseaPQRaHh9umhtBWCIDitDi\r\nvRLSKWR8Ng54X39v0vNTWhV701ppHgNofSsGqDlLKu3Beo/CBYJntjxs5Rt7\r\nDY+c88q9Lj8JgNXw0uUsyWRANXULLkB7ZtPh7hgJmCg09YP3lQmT78yPoTL8\r\nWM/luTHHwXgxVfukrbEWgyi/veTjunIEBn/DrQPPDyNJG+i7wJCkTFmUDkaE\r\nlhrN3r9q9d0nUc37fL/5/nDWI5EAf+YxVtYgftONG1VK0VaxoDsBPxmFo5bu\r\n238zEI5cbGK8/+99h2NubZc8d8dOKasfCzXjkSXWEGTEbG1ItmTGzH7pc3/J\r\nbCx4Qs7sN/sFhWFdHjurz/tg4xzKmBSnkwxfDEKlhNWNyFB6yW2iYbt0mEj6\r\nQWUF6V/sNQMQjW6pYTg9uFG7vsvFd1sJx9SzaFHKY7BAs5gpTXtoC0HSZLli\r\nQIW4fxfTHrPIKy6npWgRlA9+fmtfKBjM43KbgfkN8SMEwOYU365OUlxOOjmq\r\nil48WCe68GMt9AvtgikTSaBVkns1MzDpRvzu5lmkRHrFHz/BS89oSSClhdmU\r\niLGmlHRHXSsbT70dQQbo1t/rJTqYParh48k=\r\n=K7hZ\r\n-----END PGP SIGNATURE-----\r\n","size":10564,"noattachment":false,"key":"/@google-automations/git-file-utils/-/@google-automations/git-file-utils-1.2.2.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":"node-team-npm+wombot@google.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/git-file-utils_1.2.2_1667320508550_0.17746063015343316"},"_hasShrinkwrap":false,"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":1667320508776,"_cnpm_publish_time":1667320508776,"dist-tags":{"latest":"3.2.1"}}