🚀 DAY 1 OF LAUNCH WEEK: Reachability for Ruby Now in Beta.Learn more →
Socket
Book a DemoInstallSign in
Socket

file-system-github

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-system-github

File-system synchronization with a remote repository on Github.

latest
Source
npmnpm
Version
1.1.5
Version published
Maintainers
1
Created
Source

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

Keywords

github,fs,sync

FAQs

Package last updated on 29 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts