sync-github-to-fs
Keep a local folder up to date with the contents of a Github repository
Last updated 3 years ago by tehshrike .
WTFPL · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install sync-github-to-fs 
SYNC missed versions from official npm registry.

Syncs a branch of a repository to a local directory.

Uses the Github API. Doesn't create any local git metadata.

Deletes all files in the local directory that do not exist in the repo.

Calculates the hash of the local files and only downloads files from the repository that have different hashes than the local files.

Usage

First install, require, initialize, and if you need to, authenticate this github API wrapper module. (Last tested with 9.x.x)

const GitHubApi = require('github')

const github = new GitHubApi({
	timeout: 5000,
	headers: {
		'user-agent': 'sync-github-to-fs',
	}
})

Then, install and require this module, and do this stuff:

const sync = require('sync-github-to-fs')

const repoDetails = {
	user: 'TehShrike',
	repo: 'sync-github-to-fs',
	ref: 'heads/master',
	simultaneousRequests: 3 // defaults to 5
}

sync(github, repoDetails, '/some/local/directory', function(err, res) {
	console.log('some strings saying stuff that happened', res)
})

Current Tags

  • 2.1.0                                ...           latest (3 years ago)

5 Versions

  • 2.1.0                                ...           3 years ago
  • 2.0.0                                ...           4 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |