{"name":"@google-automations/git-file-utils","version":"1.2.4","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":"^8.0.0","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":"^15.0.0","snap-shot-it":"^7.9.6","typescript":"4.8.4"},"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":"feedc5ccceab44524cf50f5151960d502969204c","_id":"@google-automations/git-file-utils@1.2.4","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-rj3X4DTneNL1Pa28/VHdSOa6S1xxxm4NNGW8idmScJTSTFgTrtXPGSiw4eca4LuaIxP/dMgzamoWE8/g8U1sMQ==","shasum":"4802ca28b7bb53b33fd6f95f65480306ac95d1b8","tarball":"http://registry-npm.ywwl.com/@google-automations/git-file-utils/download/@google-automations/git-file-utils-1.2.4.tgz","fileCount":6,"unpackedSize":45356,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+aTReY3sTnODojwdDK2uRG4t0toatzKpII1LdfKR8lgIgAYqsyDbtL0Y30mYhpDUlUjRUQHtaJSz3wQVO6DsiuG0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpKmTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp5ZQ/5ANeoftUvxIuF9Zbs7Cj769DcQacnAUcFttNzoWye8mm1dW2d\r\n5/esGS7toxVW+kB7Q4uKdEh9xsp8GP2OpSALcEIdDMegIYkhTS3LLUCbn4rJ\r\n9W/mWnqGcCvOnhGDcbYLjN3/tctvtEbGik2NOd0w+AwQ6HvUWfyR+XWBUMDT\r\nBFjJuSVQ+XFTWY49ntJHfCBB0PpepEO1l8/Dvns63pXP/xsqea279pQysPO3\r\nxtSMe9fEr2kURDwyr/0kHkqHvvLMv/wCL+6Pqc14S0ULhtZYtw68IviyMfrE\r\nUv0M6Dg6rHv0coo+HNmTQXLjFHE9vh8ULDOk6QtvfCLSABsg32RIH3NY4pjg\r\ngaebmjC/oX+xwfdcykfvFVbdk7lKupB+S5VnBOtpPfWIFqibz6QDN3LsGZWf\r\nRmUaRNRwGU4Qf8T13fSb8m+MTqfH9tR0hWmmRjo3Be44Xa60OYPfci+nAjpS\r\nw5ivEhW8wyll+DrDGfCnKstfuVfi3mpL+qfiSeLFhSo3fFpEBEaBLqa2EXh5\r\nTTinXOOZ9v5DJSAS9y1qtmWVOTM9G2Vfl+lnPcozMEAKGOdgcOVMlJHVIsre\r\nIew926MS+iu7AU48F0ekZtfVr0ktX6tQr1W0tMUotdr3mwVEtBs1lF1qxSGj\r\neoDOW27MixqC2O6ihdSrzTebR7R7Sq6OTio=\r\n=45l3\r\n-----END PGP SIGNATURE-----\r\n","size":10559,"noattachment":false,"key":"/@google-automations/git-file-utils/-/@google-automations/git-file-utils-1.2.4.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.4_1671735698750_0.9151108938170562"},"_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":1671735698971,"_cnpm_publish_time":1671735698971,"dist-tags":{"latest":"3.2.1"}}