{"name":"@google-automations/git-file-utils","version":"1.2.6","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.7","@octokit/types":"^9.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.9.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":"854b2fc16af7f5cfec3f3d2de505b7b7a4d2969a","_id":"@google-automations/git-file-utils@1.2.6","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-wNWeNLBtQH39kTayGuJMF1IRVPxfcywH//thQHD+xzRlanTNDI/5WACUvBkIz9bhnEC7ADm5ibA+DX9meU+JwQ==","shasum":"c5999d1e7463b3f3af7337445f225a97d5c0e97e","tarball":"http://registry-npm.ywwl.com/@google-automations/git-file-utils/download/@google-automations/git-file-utils-1.2.6.tgz","fileCount":6,"unpackedSize":46090,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyx1kb4atDXm8LhTEOKvwrUpyu0JIoyZF2MFLUfwuhggIgB1h7ME5TyUoIcJ9vvKzovWSAgJ07Ol0wb6sTcG4qSsI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjztXsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1fhAAmqPn6d7JAO0z20d1QMaND8r17YJoFftAimz7iHZshjkyPYRk\r\nfw+UfWcX5gIqJlvxfPkk9O12QmJnmZt+83Qca7DkOHth26Eh9pS3sO4AWoMD\r\nsjES+ebeWV22dI+niwl9lymT68+QXOdgRxk3v0Im1DS4aNYggcbu2LoQuN9Q\r\nBiC8DY2SI1UMgYOujoLz3LAYacSGQQOeNkKtMfabOyVNliq+HsuxAV960GOm\r\nIHILr2kPlMI7iTEzQAM1jqXJ4vVjSi+H7J+HVK4qTfrxCDvZPzNbXtxwyaGo\r\nV0oho+87li6hkCr2mx4wFoCidu8uAvRd56sylpnA6mJXqTEUtgnMiRHQ0LDN\r\nSx8IbCOWODY92JzVQOSZGBXdoP5R1kETxdxQ3LROOTGoVC6fjCd1T+4ReOyk\r\nXhOmjTfCDlqcQ/LfjWEXSlBK9vsQGAY9BxH9xQtnnJ6s3esMYjXoT6AS4M8z\r\nyltRmt5RZA6YDaoHCLYKogqxQFeDA9TjdWZZrD9xOJbU0bTsBNSsDVaSwiWY\r\nYIyv+WxcITZsHJbU6owxeYfsv6O+PWxld3MSbU0Rtjv9ca4wzNqNjHn0McHu\r\nVXT5o832RpGwrxA1+6oaVS/1PAo9f0sZaeeqpO3eWDPcijpGuZh1mhM1xZHj\r\nlnNY1yz1NQ6d4feLSb/qe7XrlbF2q+y9ewU=\r\n=8zwV\r\n-----END PGP SIGNATURE-----\r\n","size":10764,"noattachment":false,"key":"/@google-automations/git-file-utils/-/@google-automations/git-file-utils-1.2.6.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.6_1674499564052_0.5853131150059685"},"_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":1674499564217,"_cnpm_publish_time":1674499564217,"dist-tags":{"latest":"3.2.1"}}