{"action":"created","comment":{"url":"https://api.github.com/repos/jeffposnick/sw-precache/pulls/comments/22949163","id":22949163,"diff_hunk":"@@ -119,11 +119,18 @@ module.exports = function(params) {\n   params.logger(util.format('Total precache size is about %s for %d resources.',\n     formatBytesAsString(cumulativeSize), relativeUrls.length));\n \n-  var templateBuffer = fs.readFileSync(params.templateFilePath);\n-  return _.template(templateBuffer, {\n-    handleFetch: params.handleFetch,\n-    importScripts: params.importScripts ? params.importScripts.map(JSON.stringify).join(',') : null,\n-    includeCachePolyfill: params.includeCachePolyfill,\n-    precacheConfig: JSON.stringify(precacheConfig)\n+  fs.readFile(params.templateFilePath, {encoding: 'utf8'}, function(error, data) {\n+    if (error) {\n+      throw error;\n+    }","path":"sw-precache.js","position":22,"original_position":22,"commit_id":"a9003a4803912d5857eb5e8e73dca368ce0f198f","original_commit_id":"a9003a4803912d5857eb5e8e73dca368ce0f198f","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"body":"Never throw in async.\r\n\r\n```js\r\nif (error) {\r\n  callback(err);\r\n  return;\r\n}\r\n```","created_at":"2015-01-14T16:37:17Z","updated_at":"2015-01-14T16:37:17Z","html_url":"https://github.com/jeffposnick/sw-precache/pull/1#discussion_r22949163","pull_request_url":"https://api.github.com/repos/jeffposnick/sw-precache/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/jeffposnick/sw-precache/pulls/comments/22949163"},"html":{"href":"https://github.com/jeffposnick/sw-precache/pull/1#discussion_r22949163"},"pull_request":{"href":"https://api.github.com/repos/jeffposnick/sw-precache/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/jeffposnick/sw-precache/pulls/1","id":27238362,"html_url":"https://github.com/jeffposnick/sw-precache/pull/1","diff_url":"https://github.com/jeffposnick/sw-precache/pull/1.diff","patch_url":"https://github.com/jeffposnick/sw-precache/pull/1.patch","issue_url":"https://api.github.com/repos/jeffposnick/sw-precache/issues/1","number":1,"state":"open","locked":false,"title":"Return a node stream instead of a string.","user":{"login":"jeffposnick","id":1749548,"avatar_url":"https://avatars.githubusercontent.com/u/1749548?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffposnick","html_url":"https://github.com/jeffposnick","followers_url":"https://api.github.com/users/jeffposnick/followers","following_url":"https://api.github.com/users/jeffposnick/following{/other_user}","gists_url":"https://api.github.com/users/jeffposnick/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffposnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffposnick/subscriptions","organizations_url":"https://api.github.com/users/jeffposnick/orgs","repos_url":"https://api.github.com/users/jeffposnick/repos","events_url":"https://api.github.com/users/jeffposnick/events{/privacy}","received_events_url":"https://api.github.com/users/jeffposnick/received_events","type":"User","site_admin":false},"body":"Hey @addyosmani, I think this follows your recommendation re: returning a stream instead of a string from the module. It also updates the demo `gulpfile.js` illustrating how the stream could be piped in as a part of a task.\r\n\r\nI picked the `lodash-template-stream` (for creating the stream from the template) and `vinyl-source-stream` modules after doing some minimal searching, so if there are other modules you'd recommend, let me know.","created_at":"2015-01-13T00:14:54Z","updated_at":"2015-01-14T16:37:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ba05ba470b8495b97b0534c83044b84f9122960","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jeffposnick/sw-precache/pulls/1/commits","review_comments_url":"https://api.github.com/repos/jeffposnick/sw-precache/pulls/1/comments","review_comment_url":"https://api.github.com/repos/jeffposnick/sw-precache/pulls/comments/{number}","comments_url":"https://api.github.com/repos/jeffposnick/sw-precache/issues/1/comments","statuses_url":"https://api.github.com/repos/jeffposnick/sw-precache/statuses/a9003a4803912d5857eb5e8e73dca368ce0f198f","head":{"label":"jeffposnick:streeeeeeeeams","ref":"streeeeeeeeams","sha":"a9003a4803912d5857eb5e8e73dca368ce0f198f","user":{"login":"jeffposnick","id":1749548,"avatar_url":"https://avatars.githubusercontent.com/u/1749548?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffposnick","html_url":"https://github.com/jeffposnick","followers_url":"https://api.github.com/users/jeffposnick/followers","following_url":"https://api.github.com/users/jeffposnick/following{/other_user}","gists_url":"https://api.github.com/users/jeffposnick/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffposnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffposnick/subscriptions","organizations_url":"https://api.github.com/users/jeffposnick/orgs","repos_url":"https://api.github.com/users/jeffposnick/repos","events_url":"https://api.github.com/users/jeffposnick/events{/privacy}","received_events_url":"https://api.github.com/users/jeffposnick/received_events","type":"User","site_admin":false},"repo":{"id":28489249,"name":"sw-precache","full_name":"jeffposnick/sw-precache","owner":{"login":"jeffposnick","id":1749548,"avatar_url":"https://avatars.githubusercontent.com/u/1749548?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffposnick","html_url":"https://github.com/jeffposnick","followers_url":"https://api.github.com/users/jeffposnick/followers","following_url":"https://api.github.com/users/jeffposnick/following{/other_user}","gists_url":"https://api.github.com/users/jeffposnick/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffposnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffposnick/subscriptions","organizations_url":"https://api.github.com/users/jeffposnick/orgs","repos_url":"https://api.github.com/users/jeffposnick/repos","events_url":"https://api.github.com/users/jeffposnick/events{/privacy}","received_events_url":"https://api.github.com/users/jeffposnick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeffposnick/sw-precache","description":"A node module to generate service worker code that will precache specific resources.","fork":false,"url":"https://api.github.com/repos/jeffposnick/sw-precache","forks_url":"https://api.github.com/repos/jeffposnick/sw-precache/forks","keys_url":"https://api.github.com/repos/jeffposnick/sw-precache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeffposnick/sw-precache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeffposnick/sw-precache/teams","hooks_url":"https://api.github.com/repos/jeffposnick/sw-precache/hooks","issue_events_url":"https://api.github.com/repos/jeffposnick/sw-precache/issues/events{/number}","events_url":"https://api.github.com/repos/jeffposnick/sw-precache/events","assignees_url":"https://api.github.com/repos/jeffposnick/sw-precache/assignees{/user}","branches_url":"https://api.github.com/repos/jeffposnick/sw-precache/branches{/branch}","tags_url":"https://api.github.com/repos/jeffposnick/sw-precache/tags","blobs_url":"https://api.github.com/repos/jeffposnick/sw-precache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeffposnick/sw-precache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeffposnick/sw-precache/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeffposnick/sw-precache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeffposnick/sw-precache/statuses/{sha}","languages_url":"https://api.github.com/repos/jeffposnick/sw-precache/languages","stargazers_url":"https://api.github.com/repos/jeffposnick/sw-precache/stargazers","contributors_url":"https://api.github.com/repos/jeffposnick/sw-precache/contributors","subscribers_url":"https://api.github.com/repos/jeffposnick/sw-precache/subscribers","subscription_url":"https://api.github.com/repos/jeffposnick/sw-precache/subscription","commits_url":"https://api.github.com/repos/jeffposnick/sw-precache/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeffposnick/sw-precache/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeffposnick/sw-precache/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeffposnick/sw-precache/issues/comments/{number}","contents_url":"https://api.github.com/repos/jeffposnick/sw-precache/contents/{+path}","compare_url":"https://api.github.com/repos/jeffposnick/sw-precache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeffposnick/sw-precache/merges","archive_url":"https://api.github.com/repos/jeffposnick/sw-precache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeffposnick/sw-precache/downloads","issues_url":"https://api.github.com/repos/jeffposnick/sw-precache/issues{/number}","pulls_url":"https://api.github.com/repos/jeffposnick/sw-precache/pulls{/number}","milestones_url":"https://api.github.com/repos/jeffposnick/sw-precache/milestones{/number}","notifications_url":"https://api.github.com/repos/jeffposnick/sw-precache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeffposnick/sw-precache/labels{/name}","releases_url":"https://api.github.com/repos/jeffposnick/sw-precache/releases{/id}","created_at":"2014-12-25T19:15:21Z","updated_at":"2015-01-12T16:16:08Z","pushed_at":"2015-01-14T16:25:30Z","git_url":"git://github.com/jeffposnick/sw-precache.git","ssh_url":"git@github.com:jeffposnick/sw-precache.git","clone_url":"https://github.com/jeffposnick/sw-precache.git","svn_url":"https://github.com/jeffposnick/sw-precache","homepage":"","size":700,"stargazers_count":33,"watchers_count":33,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":33,"default_branch":"master"}},"base":{"label":"jeffposnick:master","ref":"master","sha":"29e31451795e613ed9732d72c55aaed0b53766d5","user":{"login":"jeffposnick","id":1749548,"avatar_url":"https://avatars.githubusercontent.com/u/1749548?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffposnick","html_url":"https://github.com/jeffposnick","followers_url":"https://api.github.com/users/jeffposnick/followers","following_url":"https://api.github.com/users/jeffposnick/following{/other_user}","gists_url":"https://api.github.com/users/jeffposnick/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffposnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffposnick/subscriptions","organizations_url":"https://api.github.com/users/jeffposnick/orgs","repos_url":"https://api.github.com/users/jeffposnick/repos","events_url":"https://api.github.com/users/jeffposnick/events{/privacy}","received_events_url":"https://api.github.com/users/jeffposnick/received_events","type":"User","site_admin":false},"repo":{"id":28489249,"name":"sw-precache","full_name":"jeffposnick/sw-precache","owner":{"login":"jeffposnick","id":1749548,"avatar_url":"https://avatars.githubusercontent.com/u/1749548?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffposnick","html_url":"https://github.com/jeffposnick","followers_url":"https://api.github.com/users/jeffposnick/followers","following_url":"https://api.github.com/users/jeffposnick/following{/other_user}","gists_url":"https://api.github.com/users/jeffposnick/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffposnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffposnick/subscriptions","organizations_url":"https://api.github.com/users/jeffposnick/orgs","repos_url":"https://api.github.com/users/jeffposnick/repos","events_url":"https://api.github.com/users/jeffposnick/events{/privacy}","received_events_url":"https://api.github.com/users/jeffposnick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeffposnick/sw-precache","description":"A node module to generate service worker code that will precache specific resources.","fork":false,"url":"https://api.github.com/repos/jeffposnick/sw-precache","forks_url":"https://api.github.com/repos/jeffposnick/sw-precache/forks","keys_url":"https://api.github.com/repos/jeffposnick/sw-precache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeffposnick/sw-precache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeffposnick/sw-precache/teams","hooks_url":"https://api.github.com/repos/jeffposnick/sw-precache/hooks","issue_events_url":"https://api.github.com/repos/jeffposnick/sw-precache/issues/events{/number}","events_url":"https://api.github.com/repos/jeffposnick/sw-precache/events","assignees_url":"https://api.github.com/repos/jeffposnick/sw-precache/assignees{/user}","branches_url":"https://api.github.com/repos/jeffposnick/sw-precache/branches{/branch}","tags_url":"https://api.github.com/repos/jeffposnick/sw-precache/tags","blobs_url":"https://api.github.com/repos/jeffposnick/sw-precache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeffposnick/sw-precache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeffposnick/sw-precache/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeffposnick/sw-precache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeffposnick/sw-precache/statuses/{sha}","languages_url":"https://api.github.com/repos/jeffposnick/sw-precache/languages","stargazers_url":"https://api.github.com/repos/jeffposnick/sw-precache/stargazers","contributors_url":"https://api.github.com/repos/jeffposnick/sw-precache/contributors","subscribers_url":"https://api.github.com/repos/jeffposnick/sw-precache/subscribers","subscription_url":"https://api.github.com/repos/jeffposnick/sw-precache/subscription","commits_url":"https://api.github.com/repos/jeffposnick/sw-precache/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeffposnick/sw-precache/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeffposnick/sw-precache/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeffposnick/sw-precache/issues/comments/{number}","contents_url":"https://api.github.com/repos/jeffposnick/sw-precache/contents/{+path}","compare_url":"https://api.github.com/repos/jeffposnick/sw-precache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeffposnick/sw-precache/merges","archive_url":"https://api.github.com/repos/jeffposnick/sw-precache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeffposnick/sw-precache/downloads","issues_url":"https://api.github.com/repos/jeffposnick/sw-precache/issues{/number}","pulls_url":"https://api.github.com/repos/jeffposnick/sw-precache/pulls{/number}","milestones_url":"https://api.github.com/repos/jeffposnick/sw-precache/milestones{/number}","notifications_url":"https://api.github.com/repos/jeffposnick/sw-precache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeffposnick/sw-precache/labels{/name}","releases_url":"https://api.github.com/repos/jeffposnick/sw-precache/releases{/id}","created_at":"2014-12-25T19:15:21Z","updated_at":"2015-01-12T16:16:08Z","pushed_at":"2015-01-14T16:25:30Z","git_url":"git://github.com/jeffposnick/sw-precache.git","ssh_url":"git@github.com:jeffposnick/sw-precache.git","clone_url":"https://github.com/jeffposnick/sw-precache.git","svn_url":"https://github.com/jeffposnick/sw-precache","homepage":"","size":700,"stargazers_count":33,"watchers_count":33,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jeffposnick/sw-precache/pulls/1"},"html":{"href":"https://github.com/jeffposnick/sw-precache/pull/1"},"issue":{"href":"https://api.github.com/repos/jeffposnick/sw-precache/issues/1"},"comments":{"href":"https://api.github.com/repos/jeffposnick/sw-precache/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/jeffposnick/sw-precache/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/jeffposnick/sw-precache/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/jeffposnick/sw-precache/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/jeffposnick/sw-precache/statuses/a9003a4803912d5857eb5e8e73dca368ce0f198f"}}}}