github-tools / github

A higher-level wrapper around the Github API. Intended for the browser.
BSD 3-Clause "New" or "Revised" License
3.6k stars 758 forks source link

Commit an image to a gist #651

Open blurymind opened 3 years ago

blurymind commented 3 years ago

Can we replicate this in javascript? https://gist.github.com/mroderick/1afdd71aa69f6b29601d335751a1a9be

When I try to write it with gist.update(...), I get a bunch of binary garbage uploaded.

I can however commit images to github with {encode: false}. Can a similar parameter be passed to gist.update?

blurymind commented 3 years ago

could perhaps setting a custom media type do it? https://docs.github.com/en/rest/reference/gists#custom-media-types-for-gists

can this library even do it and if so where?

blurymind commented 3 years ago

or maybe commit it from cache, after putting it there with the filesystem api? https://www.arcusglobal.com/news/file-system-how-to