Skip to content

Commit bb05672

Browse files
committed
Updated README.md
1 parent ca8b337 commit bb05672

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,46 @@ user.userGists(username, function(err, gists) {
158158
});
159159
```
160160

161+
## Gist API
162+
163+
```js
164+
var gist = github().getGist(3165654);
165+
```
166+
167+
Read the contents of a Gist.
168+
169+
```js
170+
gist.read(function(err, gist) {
171+
172+
});
173+
```
174+
175+
Updating the contents of a Git. Please consult the documentation on [GitHub](http://developer.github.com/v3/gists/).
176+
177+
```js
178+
var delta = {
179+
"description": "the description for this gist",
180+
"files": {
181+
"file1.txt": {
182+
"content": "updated file contents"
183+
},
184+
"old_name.txt": {
185+
"filename": "new_name.txt",
186+
"content": "modified contents"
187+
},
188+
"new_file.txt": {
189+
"content": "a new file"
190+
},
191+
"delete_this_file.txt": null
192+
}
193+
};
194+
195+
gist.update(delta, function(err, gist) {
196+
197+
});
198+
```
199+
200+
161201
## Tests
162202

163203
Github.js is automatically™ tested by the users of [Prose](http://prose.io). Because of that, we decided to save some time by not maintaining a test suite. Yes, you heard right. :) However, you can still consider it stable since it is used in production.

0 commit comments

Comments
 (0)