{"name":"@google-automations/git-file-utils","version":"1.0.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.3"},"devDependencies":{"@types/chai":"^4.3.3","@types/mocha":"^9.1.1","@types/node":"^18.6.5","@types/sinon":"^10.0.13","c8":"^7.12.0","chai":"^4.3.6","cross-env":"^7.0.3","dotenv":"^16.0.1","gts":"^3.1.0","mocha":"^10.0.0","nock":"^13.2.9","sinon":"^14.0.0","snap-shot-it":"^7.9.6","typescript":"~4.7.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":"77b48ef996358d91f4487a6355eaff5d7ebbc887","_id":"@google-automations/git-file-utils@1.0.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-mqDcwsDhBs1iDkl/Zb+S9U5XuBn56Ubna/0KIJ7XIwP+0uN0y8ZS/EKZ6t79JEKRNslveweOBvWJO60HOYRqkw==","shasum":"4bfa754185b9f4cf3ecde9d2d2b9b6278d0b7517","tarball":"http://registry-npm.ywwl.com/@google-automations/git-file-utils/download/@google-automations/git-file-utils-1.0.0.tgz","fileCount":6,"unpackedSize":29475,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICTK5Z6zMu8RrStsrsjHb6lwTJF/tyDXKBRST/0yQvUMAiAniKjRPdTDZ6lvZy8uhHAgmjs0PoEFVdsnPd9oME+J9Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9CFmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpfjxAAkxx++aCpfOjPcNecvStoR6tktBModuqPKreAvC9AQBSzT83w\r\nq42C1eWHI65IlWY+4+v0BtO/2GoOomSrxzZ8l52UgVfG3Em9XpNk242YV1GJ\r\n8LkXws7VHi/xMA5Q/iysezo9PehgSKQ4Slbb4A+QdCJm74D6GUqJ5st36VA2\r\n/GWIr1PXP/QdOltnJOP+CyhHeHI6o3/EIVt9iOZBSf9c9WmEd7ytk3wB6/UY\r\nl2hxXgENhJ1kpwcbkQq+mK7zqSvK+W+6EH7EFNJtwn4s7j1gyD6ZBGe9ftkS\r\nbfYMEmd8Vb+F8QZVQmUNnSlo0y9KxONY4wukqCYcxlCiDpBkvjtuNO3N47LB\r\ngCZPboeh9qCjLabY7npta0zWWkUG2/9DGCEniTB9WRP+aaFJtxY4AmeQ7OSH\r\nSpwiXxtYtKgliHVOxrPWGAw0df2x0v6KS9yyHRhzw42lL4wP71zRAGQkAXfe\r\nk8S9VVxh8kQSf/1l1TH0lImIPzW6LW76NPAkjlCyvr5sgs5if1TlkwqyH1p4\r\npqxcjPhOMTzx9XCOveEKguCIwXxe5CoN3QHkJYhttVB2KwuzJDr1gdgXbE/m\r\nsD+O1J2eXn1FMBOVHyHtn5ed/aoKy50wCRuUUV+VFRbCtdu2n/qvlVU7lwjv\r\nwNER8Cex0Hg561aC2DJfcdse9wiHCu20EkE=\r\n=9agf\r\n-----END PGP SIGNATURE-----\r\n","size":8257,"noattachment":false,"key":"/@google-automations/git-file-utils/-/@google-automations/git-file-utils-1.0.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.0.0_1660166501966_0.13197316781939605"},"_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":1660166502101,"_cnpm_publish_time":1660166502101,"dist-tags":{"latest":"3.2.1"}}