@@ -3,31 +3,31 @@ Github.js
33
44Ever wanted to store a file on Github right from the browser? Here you are:
55
6- ```js
7- var github = new Github({
8- username: "YOU_USER",
9- password: "YOUR_PASSWORD",
10- auth: "basic"
11- });
6+ ``` js
7+ var github = new Github ({
8+ username: " YOU_USER" ,
9+ password: " YOUR_PASSWORD" ,
10+ auth: " basic"
11+ });
1212
13- // Expose API for a given repository
13+ // Expose API for a given repository
1414
15- var repo = github.getRepo(reponame);
15+ var repo = github .getRepo (reponame);
1616
17- // Store contents at a certain path (assumes UTF-8)
18- // Files that doesn't exist are created on the fly.
17+ // Store contents at a certain path (assumes UTF-8)
18+ // Files that doesn't exist are created on the fly.
1919
20- repo.write('path/to/file', 'YOUR_NEW_CONTENTS', function(err) {
21-
22- });
23- ```
20+ repo .write (' path/to/file' , ' YOUR_NEW_CONTENTS' , function (err ) {
21+
22+ });
23+ ```
2424
2525Not only can you can write files, you can of course read them:
2626
27- ```js
28- // Retrieve contents of a certain file (assumes UTF-8)
27+ ``` js
28+ // Retrieve contents of a certain file (assumes UTF-8)
2929
30- repo.read('path/to/file', function(err, data) {
31-
32- });
33- ```
30+ repo .read (' path/to/file' , function (err , data ) {
31+
32+ });
33+ ```
0 commit comments