https://github.com/niradler/git-content
get, create, update and delete files inside github repo.
https://github.com/niradler/git-content
files git npm
Last synced: 3 months ago
JSON representation
get, create, update and delete files inside github repo.
- Host: GitHub
- URL: https://github.com/niradler/git-content
- Owner: niradler
- Created: 2020-04-06T21:10:44.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-24T20:01:27.000Z (about 6 years ago)
- Last Synced: 2025-08-31T23:53:34.595Z (10 months ago)
- Topics: files, git, npm
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/git-content
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# git-content
get, create, update and delete action on files inside github repo.
## Installation
```bash
npm i -g git-content
```
### Usage
#### CLI
```bash
git-content help
git-content create --path="test3.json" --content="awesome content" --auth="XXXXXXXXXXX" --owner="niradler" --branch="master" --repo="config"
git-content get --path="test3.json" --auth="XXXXXXXXXXX" --owner="niradler" --branch="master" --repo="config"
git-content update --path="test3.json" --content="new awesome content" --auth="XXXXXXXXXXX" --owner="niradler" --branch="master" --repo="config"
git-content delete --path="test3.json" --auth="XXXXXXXXXXX" --owner="niradler" --branch="master" --repo="config"
```
#### Code
```js
const { Store, Model } = require("git-content");
const store = new Store({ owner, repo, auth, branch });
const model = new Model(store, path);
const { text } = await model.get();
```