© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Adam Bene
Founder & CTO @ Bene Studio | Join us!
Marco Alka
Software Engineer, Technical Consultant & Mentor
I use a combination of promises for async and monadic results for sync, which enables me to write consistent code with "enforced" error-handling.
'use strict'; const defer = require('promise-defer'); const Result = require('result-js'); require('verror'); const fnAsync = function() { const d = defer(); setTimeout(() => { d.reject(new VError({ name: 'DummyError', info: { code: 12345, }, }, 'This is an async %s error!', 'dummy')); }, 1000); return d.promise; }; const fnSync = function() { return Result.fromError(new VError({ name: 'DummyError', info: { code: 12345, }, }, 'This is a sync %s error!', 'dummy')); }; fnAsync().then(result => {}, error => {}); fnSync().then(result => {}, error => {});
Stephan de Vries
Full stack developer, enthusiastic about new technologies.
I use a combination of async/ await and promises! :)
Sai Kishore Komanduri Will write feedback with all problems I encountered later
Mirko Vukušić
Full(stack|dev|life)
oh, was so happy to see Promises in ES6. Babel is my best friend since then and never wrote anything in ES5 anymore :)
monadic thinking leads to more robust software
Marco Alka
Software Engineer, Technical Consultant & Mentor
I use a combination of promises for async and monadic results for sync, which enables me to write consistent code with "enforced" error-handling.
'use strict'; const defer = require('promise-defer'); const Result = require('result-js'); require('verror'); const fnAsync = function() { const d = defer(); setTimeout(() => { d.reject(new VError({ name: 'DummyError', info: { code: 12345, }, }, 'This is an async %s error!', 'dummy')); }, 1000); return d.promise; }; const fnSync = function() { return Result.fromError(new VError({ name: 'DummyError', info: { code: 12345, }, }, 'This is a sync %s error!', 'dummy')); }; fnAsync().then(result => {}, error => {}); fnSync().then(result => {}, error => {});