file-system-github
v1.1.5
Published
File-system synchronization with a remote repository on Github.
Downloads
27
Readme
file-system-github
File-system synchronization with a remote repository on Github.
Usage
Create a repository connector:
const GITHUB_TOKEN = process.env.GITHUB_TOKEN // See: https://github.com/settings/tokens
const repo = github.repo(
"my-user-agent",
"philcockfield/app-sync",
{ token: GITHUB_TOKEN }
);
Get and save a single file on the master
branch:
repo.get("/README.md")
.then(result => {
// File(s) returned as in-memory array.
// Save the files to disk by using the save method:
return result.save("/path/to/save/to");
});
Get and save an entire repository on the devel
branch:
repo.get("/", { branch: "devel" })
.then(result => {
return result.save("/path/to/save/to");
});
Test
# Run tests.
npm test
# Watch and re-run tests.
npm run tdd