{"action":"closed","issue":{"url":"https://api.github.com/repos/lovell/sharp/issues/360","repository_url":"https://api.github.com/repos/lovell/sharp","labels_url":"https://api.github.com/repos/lovell/sharp/issues/360/labels{/name}","comments_url":"https://api.github.com/repos/lovell/sharp/issues/360/comments","events_url":"https://api.github.com/repos/lovell/sharp/issues/360/events","html_url":"https://github.com/lovell/sharp/issues/360","id":133964516,"number":360,"title":"Discussion: ability to execute the pipeline synchronously","user":{"login":"nicolaspanel","id":2500584,"avatar_url":"https://avatars.githubusercontent.com/u/2500584?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolaspanel","html_url":"https://github.com/nicolaspanel","followers_url":"https://api.github.com/users/nicolaspanel/followers","following_url":"https://api.github.com/users/nicolaspanel/following{/other_user}","gists_url":"https://api.github.com/users/nicolaspanel/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolaspanel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolaspanel/subscriptions","organizations_url":"https://api.github.com/users/nicolaspanel/orgs","repos_url":"https://api.github.com/users/nicolaspanel/repos","events_url":"https://api.github.com/users/nicolaspanel/events{/privacy}","received_events_url":"https://api.github.com/users/nicolaspanel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lovell/sharp/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/lovell/sharp/labels/feedback-welcome","name":"feedback-welcome","color":"bfd4f2"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-16T12:07:48Z","updated_at":"2016-02-17T11:34:28Z","closed_at":"2016-02-17T11:34:28Z","body":"__Idea__: the current implementation always executes the pipeline asynchronously using `PipelineWorker`. It would be great to be able to execute it synchronously.\r\n\r\nExample:\r\n```js\r\nvar res = sharp(input)\r\n  .resize(200, 200)\r\n  .toFormat('jpeg')\r\n  .toBufferSync() // instead of .toBuffer(function(){...})\r\n\r\n// and\r\n\r\nvar res = sharp(input)\r\n  .resize(200, 200)\r\n  .toFormat('jpeg')\r\n  .toFileSync(pathToFile);  // instead of .toFile(pathToFile, function(){...})\r\n\r\n```\r\n\r\n@lovell : What do you think? I can work on a pull request if you like the idea."}}