{"id":26208383,"url":"https://github.com/web-pacotes/github-upsert","last_synced_at":"2026-05-02T18:33:06.555Z","repository":{"id":159159547,"uuid":"631603713","full_name":"web-pacotes/github-upsert","owner":"web-pacotes","description":"Upserts files in a GitHub repo","archived":false,"fork":false,"pushed_at":"2024-02-02T08:28:44.000Z","size":908,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-11T09:18:47.092Z","etag":null,"topics":["github-api","npm","typescript"],"latest_commit_sha":null,"homepage":"https://web-pacotes.github.io/github-upsert/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/web-pacotes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-23T14:47:30.000Z","updated_at":"2025-08-21T17:45:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"f58e347b-10f2-4b0e-9c75-741db4c7046f","html_url":"https://github.com/web-pacotes/github-upsert","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/web-pacotes/github-upsert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-pacotes%2Fgithub-upsert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-pacotes%2Fgithub-upsert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-pacotes%2Fgithub-upsert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-pacotes%2Fgithub-upsert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web-pacotes","download_url":"https://codeload.github.com/web-pacotes/github-upsert/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-pacotes%2Fgithub-upsert/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015771,"owners_count":26085748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-api","npm","typescript"],"created_at":"2025-03-12T06:28:36.580Z","updated_at":"2025-10-13T14:37:03.035Z","avatar_url":"https://github.com/web-pacotes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github-upsert\n\nUpserts file into a GitHub repo\n\n![npm version](https://badgen.net/npm/v/@web-pacotes/github-upsert) ![npm total downloads](https://badgen.net/npm/dt/@web-pacotes/github-upsert) ![bundlephobia bundle size](https://badgen.net/bundlephobia/min/@web-pacotes/github-upsert)\n\n---\n\n## How to use\n\nTo use this package, you will need a Personal Access Token (PAT) with read/write permissions for the repository you want to upload files in. Create one by going to: `Settings \u003e Developer Settings \u003e Personal Access Tokens`.\n\n```typescript\nimport { default as upsert, GitHubRepository } from 'github-upsert';\n\n// You can grab your personal access token in: Settings \u003e Developer Settings \u003e Personal Access Tokens\nconst repo = \u003cGitHubRepository\u003e{\n\tname: 'your-github-repo',\n\towner: 'your-github-username',\n\tpat: 'your-github-pat'\n};\n\nconst data = new TextEncoder().encode('Hello world!');\nconst file = \u003cFile\u003e{ data: data };\n\nconst path = 'README.md';\n\n// Upload it\nconst result = await upsert(repo, file, path);\n\n// Hoooraaaay! It should print the SHA checksum of your file!\nconsole.log(result);\n```\n\nAdditionally, you can upsert files within the CLI. Execute the following command for more info:\n\n```bash\ngithub-upsert --help\n```\n\n## Features\n\n- Uploads/updates a file in a GitHub repository\n- Upload/update folder in a GitHub repository (with recursive folder support)\n- Agnostic of `io` or file system\n- Uses native fetch lib for HTTP requests\n\n## Missing features\n\n- Support for web/lib fetch\n\n---\n\n## Scripts\n\n- `npm run build` to transpile and bundle files in `.cjs`, `.js`, `.d.ts` and respective source-maps\n- `npm run start` to run the example project with `swc` compilation\n\n- `npm run test` to run the unit tests\n- `npm run lint` to analyze and lint the project\n- `npm run format` to format the project based on lint feedback\n\n- `npm run docs` to generate docs site\n- `npm run docs:publish` to generate docs site and publish it to GitHub Pages\n\n- `npm run release` to create the temporary changesets file\n- `npm run publish` to publish the package to NPM\n\n## Hooks\n\nThis repository is configured with client-side Git hooks that automatically format + lint the codebase before each push. You can install it by running the following command:\n\n```bash\n./hooks/INSTALL\n```\n\n## Automatically Publishing to NPM\n\nTo automatically publish the package to NPM, you will need to grab a token of the publisher account for CI usage, and set it as a repository secret in GitHub under the `NPM_TOKEN` identifier.\n\n---\n\n### Bugs and Contributions\n\nFound any bug (including typos) in the package? Do you have any suggestion\nor feature to include for future releases? Please create an issue via\nGitHub in order to track each contribution. Also, pull requests are very\nwelcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb-pacotes%2Fgithub-upsert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb-pacotes%2Fgithub-upsert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb-pacotes%2Fgithub-upsert/lists"}