{"action":"created","issue":{"url":"https://api.github.com/repos/sass/node-sass/issues/1066","repository_url":"https://api.github.com/repos/sass/node-sass","labels_url":"https://api.github.com/repos/sass/node-sass/issues/1066/labels{/name}","comments_url":"https://api.github.com/repos/sass/node-sass/issues/1066/comments","events_url":"https://api.github.com/repos/sass/node-sass/issues/1066/events","html_url":"https://github.com/sass/node-sass/issues/1066","id":100484668,"number":1066,"title":"Promise support","user":{"login":"MajorBreakfast","id":340142,"avatar_url":"https://avatars.githubusercontent.com/u/340142?v=3","gravatar_id":"","url":"https://api.github.com/users/MajorBreakfast","html_url":"https://github.com/MajorBreakfast","followers_url":"https://api.github.com/users/MajorBreakfast/followers","following_url":"https://api.github.com/users/MajorBreakfast/following{/other_user}","gists_url":"https://api.github.com/users/MajorBreakfast/gists{/gist_id}","starred_url":"https://api.github.com/users/MajorBreakfast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MajorBreakfast/subscriptions","organizations_url":"https://api.github.com/users/MajorBreakfast/orgs","repos_url":"https://api.github.com/users/MajorBreakfast/repos","events_url":"https://api.github.com/users/MajorBreakfast/events{/privacy}","received_events_url":"https://api.github.com/users/MajorBreakfast/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sass/node-sass/labels/Discussion%20-%20Proposal","name":"Discussion - Proposal","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-08-12T07:30:48Z","updated_at":"2016-03-31T18:43:16Z","closed_at":null,"body":"Is there any interest in supporting promises? I'll provide a PR if you're interested. This can be added without introducing an npm dependency by detecting the Promise global via `typeof Promise !== 'undefined'` and enabling the behavior only if promises are available.\r\n\r\n```JS\r\nlet { css, map } = await sass.render({\r\n  async importer(url, prev) { ... }\r\n})\r\n```\r\n\r\n- For `sass.render()` if no callback is provided\r\n- For `options.importer()`"},"comment":{"url":"https://api.github.com/repos/sass/node-sass/issues/comments/204071950","html_url":"https://github.com/sass/node-sass/issues/1066#issuecomment-204071950","issue_url":"https://api.github.com/repos/sass/node-sass/issues/1066","id":204071950,"user":{"login":"callumlocke","id":250617,"avatar_url":"https://avatars.githubusercontent.com/u/250617?v=3","gravatar_id":"","url":"https://api.github.com/users/callumlocke","html_url":"https://github.com/callumlocke","followers_url":"https://api.github.com/users/callumlocke/followers","following_url":"https://api.github.com/users/callumlocke/following{/other_user}","gists_url":"https://api.github.com/users/callumlocke/gists{/gist_id}","starred_url":"https://api.github.com/users/callumlocke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callumlocke/subscriptions","organizations_url":"https://api.github.com/users/callumlocke/orgs","repos_url":"https://api.github.com/users/callumlocke/repos","events_url":"https://api.github.com/users/callumlocke/events{/privacy}","received_events_url":"https://api.github.com/users/callumlocke/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T18:43:16Z","updated_at":"2016-03-31T18:43:16Z","body":"@xzyfer Are you sure you want to retain the old API alongside a new promise-based API? Why not do a major version bump, embrace promises, and simplify the codebase?\r\n\r\nThe existing callback API is outdated and confusing. The fact you can call `done(err)` or `done(result)` (but not `done(null, result)`) is not even consistent with Node's old conventions, and it provides absolutely no extra functionality compared to promises. Maintaining this old API alongside a new promise API sounds messy (it would involve duck-typing the importer function's return value and/or reading the function's `length` property to see if it explictly accepts a `done` argument, neither of which are foolproof). I highly recommend breaking with the past here."}}