With deferred (using your library of choice):
const deferred = library.defer();
if (condition) deferred.resolve('success');
else deferred.reject('fail');
deferred.promise.then((result) => console.log(result));
Just wrapping in a promise:
new Promise((resolve, reject) => {
if (condition) resolve('success');
else reject('fail');
}).then((result) => console.log(result));
What's the difference between these two scenarios? Is the only real benefit that you don't have to wrap all your code in a promise? If that's the case what's the point of a deferred?