{"name":"@google-automations/git-file-utils","version":"1.2.5","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":"cb5e51b0f9bcbe6fb9f17de256926edfc794cbcc","_id":"@google-automations/git-file-utils@1.2.5","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-1fJ/+W5yzyzGIVet8SHUSF5zFJyhwNKoUB34oXp7zL72L6arwOhUs5CQ9S45cw3ReCFleAB9MjwX0f120ufX8g==","shasum":"a1e43fc575044b383e3ea9e5672aa944268a3307","tarball":"http://registry-npm.ywwl.com/@google-automations/git-file-utils/download/@google-automations/git-file-utils-1.2.5.tgz","fileCount":6,"unpackedSize":46088,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAQhWNN3syx1+R/XlbzgUGA3bFNqty4PClburNuUO+CQIgfprCakfvjxdRs3HsIYC52JAIdS69HyovWhwZOr2avnk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtyyZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrf+w/+OPDw0nPOQGSfJaTvBiH2Vob1rf15KWf45XyE0ydfVs/hagOl\r\npQH6GyjK8hsv/Ynk53zah68qQmi7TxouGHz4ukU3yRLxJxJQKk0ESFXfzY5w\r\neJtvvKb0/6wp+AXk3MexnByx0PgZEfxhHLrE68h/bsynBZOmenr5kCWItgbm\r\npNtTEK3doWzBQpV4tMLNUESmjcWv3YB2zd1IKApSRTAH6H+MkSRy+QSn+baB\r\ncU6G01L4cOLXdY7Ymx95X5ND9+Lj4DueFmOs7/d+9E8jWrt2Buc1CT/joUM2\r\nyPmoDqoQJHbqd8kFmQTvtJ9d8iRxTrqrmYemlkoObCDMYZ17JZNU1ET3xPPv\r\nw8K/NmTQrdez7yezmsTTSV4Ssl7yNOHLSj87WMhTIV2v8w0fDuui0Ih1q1vh\r\n3X9EZMWc1gkYN/6ouCQWS+9cQO633IrQKLfO6H9K17r7SAr9hFYLTCWcGTLB\r\n+5Wcfd0MMjGJZkM1X5uLo1HvKf2VugBDccs60ctyhN2npRNpXdv/XCLXd7uM\r\ninTcxYlQBNrkfUQ59LR2oYW71xBjS0Jnmk0pDBo2nDfi8ix6TkdVkPztYzkT\r\nVWriBCtg0QIe8Q6BMqo3v7UKViHFaFa9wM557Lj+CdItqO80Ep5uC/fpvSf2\r\nVDq0kR7fIgpPogn+b6XhNUkT3QrWsvkjEN0=\r\n=54jn\r\n-----END PGP SIGNATURE-----\r\n","size":10764,"noattachment":false,"key":"/@google-automations/git-file-utils/-/@google-automations/git-file-utils-1.2.5.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.5_1672948889776_0.9277623587072306"},"_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":1672948889948,"_cnpm_publish_time":1672948889948,"dist-tags":{"latest":"3.2.1"}}