1.1.5 • Published 10 years ago

file-system-github v1.1.5

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

file-system-github

Build Status

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

License: MIT

1.1.5

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago