{"name":"@google-automations/git-file-utils","version":"1.2.0","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","minimatch":"^5.1.0"},"devDependencies":{"@types/chai":"^4.3.3","@types/minimatch":"^5.1.2","@types/mocha":"^9.1.1","@types/node":"^18.7.13","@types/sinon":"^10.0.13","c8":"^7.12.0","chai":"^4.3.6","cross-env":"^7.0.3","dotenv":"^16.0.1","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":"cade620d087f37c32dc2e45c4d5c203dc849ec69","_id":"@google-automations/git-file-utils@1.2.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-tHkJQznc9uSBlOoss1vEwTZz/0uM3xLKFapfRX0u2gLTLciCktIsldhbS2GUVWPSvNUxcDgIr9n6iOqAunsQqg==","shasum":"616bbcff928930827e0a99cd0a50f1e4832d26d0","tarball":"http://registry-npm.ywwl.com/@google-automations/git-file-utils/download/@google-automations/git-file-utils-1.2.0.tgz","fileCount":6,"unpackedSize":44158,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnk2xsM2pz3pkLqz79ic4YPJR/haGm6GupWoYXXVHregIgX2JLjR59nBA0ArFQ0c4kQMPFfoaUUzQQ3cYtiYYy0Jc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjD/FDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo0qw/9FbB6hsz7zZV+THmGUFJ3AavUYzMmeODZZXzNeKF6y4WqDo1T\r\nzjyaXeN9C0j5Ba7mz8MFUXODLYagG9TXKSTYKiInyWRYFglNc+bwKE/wyDqg\r\nZUXCDLGg0U+oV86LHM9wKb7n7iIb6LUgES/U5tPyfrY3LsSisYSDI1uLU25P\r\ni8nXe02qmmg4V8BtRtxQ8MEWSqiMUjHzoD7Ki5qko4Wr6g1LDOkmC20jPIB4\r\no42wvUlBdC+ZKM8FIBJpWTtGWpf+8h5TG9VQQDl9iM8J5ADKFmHal/NtiBt9\r\nNuPldUkhv8jXTwydNQQmPod0U6otxTLSuMrC4R3DV4cS17pCHBTsJmhFblWO\r\n7z//iceAYp5O1Hhp3BEK1tilIV1kKlPSLx4/wuc82qSH651OBjTovsmelxs8\r\noTRTxJ3PeZU8tSHDbMD0dt0U3OGvDX74gxdz7aoMaRTUPThdKbg92v6FBjJ7\r\naTfiXnqh5vvYM5tVd7ItwhFZecNn4deOUpBRAEZQTnXwXgYPEQ8h3pD6xVKF\r\nRutILUEvC+1PSwc+g86YjCX7gHucsHfyb+uOSFdsBsxX7HHprdVkdC74aUyA\r\ny4eh4ljwsmLtLqzo6TvUcA2Qar7OTyMTkSCHINMcsyeBXjNTLBQJlPmi5lfQ\r\nH43+T1JtyKdOcYaA1xN2uVTMGe8GIzx/uIE=\r\n=PQ6E\r\n-----END PGP SIGNATURE-----\r\n","size":10331,"noattachment":false,"key":"/@google-automations/git-file-utils/-/@google-automations/git-file-utils-1.2.0.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.0_1661989187152_0.4034585500553962"},"_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":1661989187400,"_cnpm_publish_time":1661989187400,"dist-tags":{"latest":"3.2.1"}}