GitHub Folder Sync v1.3.0 Documentation
Table of contents
Description
This library can be used to sync a folder from your device to GitHub.
This is a fun project, and I do not recommend pushing the large files.
Installation
npm i github-folder-sync
Usage example
import { homedir } from 'os'
import { join } from 'path'
import { GitHubFolderSync } from 'github-folder-sync'
const gitHubFolderSync = new GitHubFolderSync(
join(homedir(), 'Desktop', 'my-folder'),
60_000 * 5,
'some-repo',
'ghp_c23sd2lMESl5nZsDs4Szzsj5Na2SiS1Yu62k',
'datomarjanidze',
'main'
)
gitHubFolderSync.start()
API
GitHubFolderSync
class constructor parameters:
folderPath {string}
: Absolute path of a folder to syncsyncInterval {number}
: Frequency of sync in millisecondsgitHubRepoName {string}
: Repository name on GitHubgitHubToken {string}
: Personal access token generated on GitHubgitHubUsername {string}
: GitHub username/organizationbranchName {string}
: The name of the branch you want to sync
GitHubFolderSync
class methods:
start
: Starts syncing. Return value voidstop
: Stops syncing. Return value voidsync (async)
: In case it is needed to manually execute sync and
not wait until next sync tick. Return value void