开发者社区> 镜像站> NPM> file-system-github
file-system-github
File-system synchronization with a remote repository on Github.
Last updated 5 years ago by philcockfield .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install file-system-github 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.1.5                                ...           latest (5 years ago)

10 Versions

  • 1.1.5                                ...           5 years ago
  • 1.1.4                                ...           5 years ago
  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           5 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 (10)
Dependents (1)