github-folder-sync
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 to push large files.
Usage example
const { homedir } = require('os')
const { join } = require('path')
const { GitHubFolderSync } = require('github-folder-sync')
const gitHubFolderSync = new GitHubFolderSync(
join(homedir(), 'Desktop', 'my-folder'),
60_000 * 5,
'some-repo',
'ghp_c23sd2lMESl5nZsDs4Szzsj5Na2SiS1Yu62k',
'datomarjanidze',
'main',
)
gitHubFolderSync.start()
Specs
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