mikedeboer/node-github — pull request #166 by greggman (2014-07-01 19:06:29+00:00)
Title: Adds the upload asset release api

Here's a first pass at adding this feature. Please tell me if you'd
like it implemented a different way. Of course I like it as is :P
but some things to consider

* Content-Type

Currently I set the content type automatically based on the name
you pass in. This is a little magic as it assumes there's both
a `filePath` and `name` field.

It could be required to be set by the user as in

github.releases.uploadAsset({
owner: owner,
id: releaseId,
headers: {
"content-type": "application/zip",
}
...

Similarly the size could be manually set there. But, since, based
on the current API there's no way for us to upload the file (we
don't get the request object back, and we can't just pass the
data (it's arguably too big. Could be 100s of meg, more than
fits in node's memory space), it seems like we should lookup
the size and stream the file as it does now?

* Timeout

Wasn't sure what to do about that. Timeouts don't seem appropriate
for uploading giant files or at least can't easily be a global
setting.

Anyway, if you don't like this patch hopefully you can suggest a way
you'd prefer it.