1.3.0 • Published 11 months ago

github-folder-sync v1.3.0

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

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, // Sync in every 5 minutes.
  'some-repo',
  'ghp_c23sd2lMESl5nZsDs4Szzsj5Na2SiS1Yu62k',
  'datomarjanidze',
  'main'
)

gitHubFolderSync.start()

API

  • GitHubFolderSync class constructor parameters:
    • folderPath {string}: Absolute path of a folder to sync
    • syncInterval {number}: Frequency of sync in milliseconds
    • gitHubRepoName {string}: Repository name on GitHub
    • gitHubToken {string}: Personal access token generated on GitHub
    • gitHubUsername {string}: GitHub username/organization
    • branchName {string}: The name of the branch you want to sync
  • GitHubFolderSync class methods:
    • start: Starts syncing. Return value void
    • stop: Stops syncing. Return value void
    • sync (async): In case it is needed to manually execute sync and not wait until next sync tick. Return value void
1.3.0

11 months ago

1.2.0

1 year ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago