{"action":"created","comment":{"url":"https://api.github.com/repos/claudetech/koa-stream/pulls/comments/43606101","id":43606101,"diff_hunk":"@@ -13,13 +13,27 @@ $ npm install koa-stream\n \n ## Usage\n \n+### Stream Files\n+\n+```javascript\n+var streamFile = require('koa-stream').streamFile;\n+var path   = require('path');\n+var app    = require('koa');\n+\n+app.use(function *() {\n+    yield streamFile(this, 'my-video.mp4', {root: path.join(__dirname, '/public')});\n+});\n+```\n+\n+### Stream Buffers\n+\n ```javascript\n-var stream = require('koa-stream');\n+var streamBuffer = require('koa-stream').streamBuffer;\n var path   = require('path');\n var app    = require('koa');\n \n app.use(function *() {\n-    yield stream('my-video.mp4', {root: path.join(__dirname, '/public')});\n+    streamBuffer(this, new Buffer([1,2,3]), 'image/png', {allowDownload: true});","path":"README.md","position":35,"original_position":35,"commit_id":"83f3f91f10564f75a2dc7963f74358c7c0d2649d","original_commit_id":"83f3f91f10564f75a2dc7963f74358c7c0d2649d","user":{"login":"tuvistavie","id":1436271,"avatar_url":"https://avatars.githubusercontent.com/u/1436271?v=3","gravatar_id":"","url":"https://api.github.com/users/tuvistavie","html_url":"https://github.com/tuvistavie","followers_url":"https://api.github.com/users/tuvistavie/followers","following_url":"https://api.github.com/users/tuvistavie/following{/other_user}","gists_url":"https://api.github.com/users/tuvistavie/gists{/gist_id}","starred_url":"https://api.github.com/users/tuvistavie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuvistavie/subscriptions","organizations_url":"https://api.github.com/users/tuvistavie/orgs","repos_url":"https://api.github.com/users/tuvistavie/repos","events_url":"https://api.github.com/users/tuvistavie/events{/privacy}","received_events_url":"https://api.github.com/users/tuvistavie/received_events","type":"User","site_admin":false},"body":"Oh, you're prefectly right.\r\nI completely forgot I was using a generator only to check if the file already existed.","created_at":"2015-11-02T08:40:47Z","updated_at":"2015-11-02T08:40:47Z","html_url":"https://github.com/claudetech/koa-stream/pull/1#discussion_r43606101","pull_request_url":"https://api.github.com/repos/claudetech/koa-stream/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/claudetech/koa-stream/pulls/comments/43606101"},"html":{"href":"https://github.com/claudetech/koa-stream/pull/1#discussion_r43606101"},"pull_request":{"href":"https://api.github.com/repos/claudetech/koa-stream/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/claudetech/koa-stream/pulls/1","id":49403154,"html_url":"https://github.com/claudetech/koa-stream/pull/1","diff_url":"https://github.com/claudetech/koa-stream/pull/1.diff","patch_url":"https://github.com/claudetech/koa-stream/pull/1.patch","issue_url":"https://api.github.com/repos/claudetech/koa-stream/issues/1","number":1,"state":"open","locked":false,"title":"Added support for streaming Buffers","user":{"login":"konzeptteam","id":4499673,"avatar_url":"https://avatars.githubusercontent.com/u/4499673?v=3","gravatar_id":"","url":"https://api.github.com/users/konzeptteam","html_url":"https://github.com/konzeptteam","followers_url":"https://api.github.com/users/konzeptteam/followers","following_url":"https://api.github.com/users/konzeptteam/following{/other_user}","gists_url":"https://api.github.com/users/konzeptteam/gists{/gist_id}","starred_url":"https://api.github.com/users/konzeptteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konzeptteam/subscriptions","organizations_url":"https://api.github.com/users/konzeptteam/orgs","repos_url":"https://api.github.com/users/konzeptteam/repos","events_url":"https://api.github.com/users/konzeptteam/events{/privacy}","received_events_url":"https://api.github.com/users/konzeptteam/received_events","type":"User","site_admin":false},"body":"Allows use of the library if binary data is retrieved from other data sources than the file system","created_at":"2015-11-02T07:51:57Z","updated_at":"2015-11-02T08:40:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09c68c7f7ee026ff9f5e78ad54314ae08bddcbd8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/claudetech/koa-stream/pulls/1/commits","review_comments_url":"https://api.github.com/repos/claudetech/koa-stream/pulls/1/comments","review_comment_url":"https://api.github.com/repos/claudetech/koa-stream/pulls/comments{/number}","comments_url":"https://api.github.com/repos/claudetech/koa-stream/issues/1/comments","statuses_url":"https://api.github.com/repos/claudetech/koa-stream/statuses/83f3f91f10564f75a2dc7963f74358c7c0d2649d","head":{"label":"konzeptteam:master","ref":"master","sha":"83f3f91f10564f75a2dc7963f74358c7c0d2649d","user":{"login":"konzeptteam","id":4499673,"avatar_url":"https://avatars.githubusercontent.com/u/4499673?v=3","gravatar_id":"","url":"https://api.github.com/users/konzeptteam","html_url":"https://github.com/konzeptteam","followers_url":"https://api.github.com/users/konzeptteam/followers","following_url":"https://api.github.com/users/konzeptteam/following{/other_user}","gists_url":"https://api.github.com/users/konzeptteam/gists{/gist_id}","starred_url":"https://api.github.com/users/konzeptteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konzeptteam/subscriptions","organizations_url":"https://api.github.com/users/konzeptteam/orgs","repos_url":"https://api.github.com/users/konzeptteam/repos","events_url":"https://api.github.com/users/konzeptteam/events{/privacy}","received_events_url":"https://api.github.com/users/konzeptteam/received_events","type":"User","site_admin":false},"repo":{"id":45253669,"name":"koa-stream","full_name":"konzeptteam/koa-stream","owner":{"login":"konzeptteam","id":4499673,"avatar_url":"https://avatars.githubusercontent.com/u/4499673?v=3","gravatar_id":"","url":"https://api.github.com/users/konzeptteam","html_url":"https://github.com/konzeptteam","followers_url":"https://api.github.com/users/konzeptteam/followers","following_url":"https://api.github.com/users/konzeptteam/following{/other_user}","gists_url":"https://api.github.com/users/konzeptteam/gists{/gist_id}","starred_url":"https://api.github.com/users/konzeptteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konzeptteam/subscriptions","organizations_url":"https://api.github.com/users/konzeptteam/orgs","repos_url":"https://api.github.com/users/konzeptteam/repos","events_url":"https://api.github.com/users/konzeptteam/events{/privacy}","received_events_url":"https://api.github.com/users/konzeptteam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/konzeptteam/koa-stream","description":"Send file with range requests","fork":true,"url":"https://api.github.com/repos/konzeptteam/koa-stream","forks_url":"https://api.github.com/repos/konzeptteam/koa-stream/forks","keys_url":"https://api.github.com/repos/konzeptteam/koa-stream/keys{/key_id}","collaborators_url":"https://api.github.com/repos/konzeptteam/koa-stream/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/konzeptteam/koa-stream/teams","hooks_url":"https://api.github.com/repos/konzeptteam/koa-stream/hooks","issue_events_url":"https://api.github.com/repos/konzeptteam/koa-stream/issues/events{/number}","events_url":"https://api.github.com/repos/konzeptteam/koa-stream/events","assignees_url":"https://api.github.com/repos/konzeptteam/koa-stream/assignees{/user}","branches_url":"https://api.github.com/repos/konzeptteam/koa-stream/branches{/branch}","tags_url":"https://api.github.com/repos/konzeptteam/koa-stream/tags","blobs_url":"https://api.github.com/repos/konzeptteam/koa-stream/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/konzeptteam/koa-stream/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/konzeptteam/koa-stream/git/refs{/sha}","trees_url":"https://api.github.com/repos/konzeptteam/koa-stream/git/trees{/sha}","statuses_url":"https://api.github.com/repos/konzeptteam/koa-stream/statuses/{sha}","languages_url":"https://api.github.com/repos/konzeptteam/koa-stream/languages","stargazers_url":"https://api.github.com/repos/konzeptteam/koa-stream/stargazers","contributors_url":"https://api.github.com/repos/konzeptteam/koa-stream/contributors","subscribers_url":"https://api.github.com/repos/konzeptteam/koa-stream/subscribers","subscription_url":"https://api.github.com/repos/konzeptteam/koa-stream/subscription","commits_url":"https://api.github.com/repos/konzeptteam/koa-stream/commits{/sha}","git_commits_url":"https://api.github.com/repos/konzeptteam/koa-stream/git/commits{/sha}","comments_url":"https://api.github.com/repos/konzeptteam/koa-stream/comments{/number}","issue_comment_url":"https://api.github.com/repos/konzeptteam/koa-stream/issues/comments{/number}","contents_url":"https://api.github.com/repos/konzeptteam/koa-stream/contents/{+path}","compare_url":"https://api.github.com/repos/konzeptteam/koa-stream/compare/{base}...{head}","merges_url":"https://api.github.com/repos/konzeptteam/koa-stream/merges","archive_url":"https://api.github.com/repos/konzeptteam/koa-stream/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/konzeptteam/koa-stream/downloads","issues_url":"https://api.github.com/repos/konzeptteam/koa-stream/issues{/number}","pulls_url":"https://api.github.com/repos/konzeptteam/koa-stream/pulls{/number}","milestones_url":"https://api.github.com/repos/konzeptteam/koa-stream/milestones{/number}","notifications_url":"https://api.github.com/repos/konzeptteam/koa-stream/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/konzeptteam/koa-stream/labels{/name}","releases_url":"https://api.github.com/repos/konzeptteam/koa-stream/releases{/id}","created_at":"2015-10-30T13:51:00Z","updated_at":"2015-10-30T13:51:01Z","pushed_at":"2015-11-02T08:17:35Z","git_url":"git://github.com/konzeptteam/koa-stream.git","ssh_url":"git@github.com:konzeptteam/koa-stream.git","clone_url":"https://github.com/konzeptteam/koa-stream.git","svn_url":"https://github.com/konzeptteam/koa-stream","homepage":"https://www.npmjs.com/package/koa-stream","size":88,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"claudetech:master","ref":"master","sha":"0e02aa423c7d45dd2738c2f163cecd8992639a93","user":{"login":"claudetech","id":6198749,"avatar_url":"https://avatars.githubusercontent.com/u/6198749?v=3","gravatar_id":"","url":"https://api.github.com/users/claudetech","html_url":"https://github.com/claudetech","followers_url":"https://api.github.com/users/claudetech/followers","following_url":"https://api.github.com/users/claudetech/following{/other_user}","gists_url":"https://api.github.com/users/claudetech/gists{/gist_id}","starred_url":"https://api.github.com/users/claudetech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudetech/subscriptions","organizations_url":"https://api.github.com/users/claudetech/orgs","repos_url":"https://api.github.com/users/claudetech/repos","events_url":"https://api.github.com/users/claudetech/events{/privacy}","received_events_url":"https://api.github.com/users/claudetech/received_events","type":"Organization","site_admin":false},"repo":{"id":37712392,"name":"koa-stream","full_name":"claudetech/koa-stream","owner":{"login":"claudetech","id":6198749,"avatar_url":"https://avatars.githubusercontent.com/u/6198749?v=3","gravatar_id":"","url":"https://api.github.com/users/claudetech","html_url":"https://github.com/claudetech","followers_url":"https://api.github.com/users/claudetech/followers","following_url":"https://api.github.com/users/claudetech/following{/other_user}","gists_url":"https://api.github.com/users/claudetech/gists{/gist_id}","starred_url":"https://api.github.com/users/claudetech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudetech/subscriptions","organizations_url":"https://api.github.com/users/claudetech/orgs","repos_url":"https://api.github.com/users/claudetech/repos","events_url":"https://api.github.com/users/claudetech/events{/privacy}","received_events_url":"https://api.github.com/users/claudetech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/claudetech/koa-stream","description":"Send file with range requests","fork":false,"url":"https://api.github.com/repos/claudetech/koa-stream","forks_url":"https://api.github.com/repos/claudetech/koa-stream/forks","keys_url":"https://api.github.com/repos/claudetech/koa-stream/keys{/key_id}","collaborators_url":"https://api.github.com/repos/claudetech/koa-stream/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/claudetech/koa-stream/teams","hooks_url":"https://api.github.com/repos/claudetech/koa-stream/hooks","issue_events_url":"https://api.github.com/repos/claudetech/koa-stream/issues/events{/number}","events_url":"https://api.github.com/repos/claudetech/koa-stream/events","assignees_url":"https://api.github.com/repos/claudetech/koa-stream/assignees{/user}","branches_url":"https://api.github.com/repos/claudetech/koa-stream/branches{/branch}","tags_url":"https://api.github.com/repos/claudetech/koa-stream/tags","blobs_url":"https://api.github.com/repos/claudetech/koa-stream/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/claudetech/koa-stream/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/claudetech/koa-stream/git/refs{/sha}","trees_url":"https://api.github.com/repos/claudetech/koa-stream/git/trees{/sha}","statuses_url":"https://api.github.com/repos/claudetech/koa-stream/statuses/{sha}","languages_url":"https://api.github.com/repos/claudetech/koa-stream/languages","stargazers_url":"https://api.github.com/repos/claudetech/koa-stream/stargazers","contributors_url":"https://api.github.com/repos/claudetech/koa-stream/contributors","subscribers_url":"https://api.github.com/repos/claudetech/koa-stream/subscribers","subscription_url":"https://api.github.com/repos/claudetech/koa-stream/subscription","commits_url":"https://api.github.com/repos/claudetech/koa-stream/commits{/sha}","git_commits_url":"https://api.github.com/repos/claudetech/koa-stream/git/commits{/sha}","comments_url":"https://api.github.com/repos/claudetech/koa-stream/comments{/number}","issue_comment_url":"https://api.github.com/repos/claudetech/koa-stream/issues/comments{/number}","contents_url":"https://api.github.com/repos/claudetech/koa-stream/contents/{+path}","compare_url":"https://api.github.com/repos/claudetech/koa-stream/compare/{base}...{head}","merges_url":"https://api.github.com/repos/claudetech/koa-stream/merges","archive_url":"https://api.github.com/repos/claudetech/koa-stream/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/claudetech/koa-stream/downloads","issues_url":"https://api.github.com/repos/claudetech/koa-stream/issues{/number}","pulls_url":"https://api.github.com/repos/claudetech/koa-stream/pulls{/number}","milestones_url":"https://api.github.com/repos/claudetech/koa-stream/milestones{/number}","notifications_url":"https://api.github.com/repos/claudetech/koa-stream/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/claudetech/koa-stream/labels{/name}","releases_url":"https://api.github.com/repos/claudetech/koa-stream/releases{/id}","created_at":"2015-06-19T09:04:20Z","updated_at":"2015-10-23T11:27:26Z","pushed_at":"2015-11-02T08:17:35Z","git_url":"git://github.com/claudetech/koa-stream.git","ssh_url":"git@github.com:claudetech/koa-stream.git","clone_url":"https://github.com/claudetech/koa-stream.git","svn_url":"https://github.com/claudetech/koa-stream","homepage":"https://www.npmjs.com/package/koa-stream","size":120,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/claudetech/koa-stream/pulls/1"},"html":{"href":"https://github.com/claudetech/koa-stream/pull/1"},"issue":{"href":"https://api.github.com/repos/claudetech/koa-stream/issues/1"},"comments":{"href":"https://api.github.com/repos/claudetech/koa-stream/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/claudetech/koa-stream/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/claudetech/koa-stream/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/claudetech/koa-stream/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/claudetech/koa-stream/statuses/83f3f91f10564f75a2dc7963f74358c7c0d2649d"}}}}