GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — github/README.md at master · stdclass/github

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
67 lines (44 loc) · 1.16 KB
/

README.md

Copy path

File metadata and controls

67 lines (44 loc) · 1.16 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Github.js

Ever wanted to store a file on Github right from the browser? Here you are.

Expose API for a given repository.

var github = new Github({
  username: "YOU_USER",
  password: "YOUR_PASSWORD",
  auth: "basic"
});

var repo = github.getRepo(reponame);

Retrieve all available branches (aka heads) of a repository.

repo.listBranches(function(err, branches) {
  
});

Store contents at a certain path, where files that don't yet exist are created on the fly.

repo.write('master', 'path/to/file', 'YOUR_NEW_CONTENTS', 'YOUR_COMMIT_MESSAGE', function(err) {
  
});

Not only can you can write files, you can of course read them.

// Retrieve contents of a certain file (assumes UTF-8)

repo.read('master', 'path/to/file', function(err, data) {
  
});

Listing all files of a repository is easy too.

repo.list('master', 'path/to/file', function(err, data) {
  
});

Node.js

To use Github.js on a node.js server, include it with require():

var Github = require("/path/to/github.js");

var github = new Github({
  username: "YOU_USER",
  password: "YOUR_PASSWORD",
  auth: "basic"
});
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.