{"name":"@google-automations/git-file-utils","version":"1.2.1","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.4","@octokit/types":"^7.5.1","minimatch":"^5.1.0"},"devDependencies":{"@types/chai":"^4.3.3","@types/minimatch":"^5.1.2","@types/mocha":"^9.1.1","@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":"aa699b85fe3db61639d239bb03fc11762caf2015","_id":"@google-automations/git-file-utils@1.2.1","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-gI3YQg5tYHPEc1aeOuNoCSOQEptbRH7+vc2rxLaq5z854667ev4Mw19mCyi/fh5/DDzomKh3569SshD0dgtnDA==","shasum":"023639bd871d630db3e67654b354b29c9c770b16","tarball":"http://registry-npm.ywwl.com/@google-automations/git-file-utils/download/@google-automations/git-file-utils-1.2.1.tgz","fileCount":6,"unpackedSize":45356,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1Qxs2dS8ysQgpWhWHQ9euoqWQCsPglGuRu3z2fOVAQAIgHXWx0KJdYDeNMi4saygc/yhG0DzZ3qsydI4ENcD8koI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjO2brACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMpRAAh/QCQuRTU9EJixjQ/CUFdtyhVAVNnzH8zRqmsQLPDpp2kuC+\r\ne8/AzQtVXU2ioOvaSpjaToLPBBHOh9QhZ9P8MRNMhsuiiAOonXTTA0vgirXx\r\nQazky5I/MnuUaK1VHNRDion+NP+rfbK+8qZ4Nz6oWMqu2zfK+dPkMyfvmTU4\r\nVfVRzgH2pmPwwAUrgmEadz3e3SBpA1sYraJ12gO1oW0Hp0nzRIfhxeYIZZzM\r\nYpjgsXOTYQ0Pp9DdXigNE1Ft59dKSsU5GgTz5Gg62/0tw9gDmnnd7BUVgRIv\r\nCEgeUncu005lWqLTqIX254N0gloEtGfjOOCGq7deWuEu40BS8/xacbJlIdeS\r\neLi2iW5EBvppHmdGK0td0LyieyAs8h04Xf4JnEQQbl18KNW6Xtn+MxTgGD3z\r\nAZ6SXGe2hQY5RF1k/cDFdpQ14MMl/ba55fxegmPiao5DvupppfBr02eFDWvq\r\n28IwSl/CqBhCbyNKuSTzVbdbxfANEZ8aa2KNncL3z82jdWdI1HG3vg5NRQ+Z\r\n8VsyIrLaDrCJsPCd19PUZYgZOMDgs8lWtIk4uYL756lEfy+dhL5bhtiAArBk\r\nVOcBU1HWBgA/5B2X/pDphPV4hIZYZnSx1pZk6y65LvPForxv+FEoVvsg+eiL\r\nw99kGGCe27Isu6eDmWMuqGWFeEbXufTspqg=\r\n=6hhy\r\n-----END PGP SIGNATURE-----\r\n","size":10572,"noattachment":false,"key":"/@google-automations/git-file-utils/-/@google-automations/git-file-utils-1.2.1.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.1_1664837355593_0.5766637689796117"},"_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":1664837355815,"_cnpm_publish_time":1664837355815,"dist-tags":{"latest":"3.2.1"}}