🐙 github-tree
Github API commits made easy peasy.
Overview
This library helps you create commits to Github using a simple API that abstracts away core git functionality.
Installation
yarn add github-tree
How to use it?
It's very simple! There's a commit
method that takes Octokit
instance as an argument and a handful of other inputs, including tree
, that represent your next commit.
⚠️ Note that the current state of
github-tree
doesn't support partial commits. Every folder you make in a tree wipes all existing data out.
await commit
This will create one file in the repository root - README.md
- and one in folder src
- index.ts
.
It is common that you want to commit more files during a particular commit. Perhaps even a whole repository setup! In case you need such functionality, there's a loadTreeFromPath
method that can help you load files from your file system and convert them into a Tree
.
// ... await commit_,
Other methods
/* Tree */ /** * Creates a base64 encoded file. */ /* Github */ /** * Input variables for commit method. */ /* Utility functions */ /** * Loads a tree of utf-8 decoded files at paths. */ /** * Lets you map files asynchornously. */ /** * Lets you manipulate file paths. */
License
MIT @ Matic Zavadlal