@@ -3,31 +3,31 @@ Github.js
3
3
4
4
Ever wanted to store a file on Github right from the browser? Here you are:
5
5
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
+ });
12
12
13
- // Expose API for a given repository
13
+ // Expose API for a given repository
14
14
15
- var repo = github.getRepo(reponame);
15
+ var repo = github .getRepo (reponame);
16
16
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.
19
19
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
+ ```
24
24
25
25
Not only can you can write files, you can of course read them:
26
26
27
- ```js
28
- // Retrieve contents of a certain file (assumes UTF-8)
27
+ ``` js
28
+ // Retrieve contents of a certain file (assumes UTF-8)
29
29
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