/carefree

Call a promise or callback function without care any exception

Primary LanguageJavaScriptMIT LicenseMIT

carefree

Call a promise or callback function without care any exception

const carefree = require('carefree');

(async ()=> {
  await carefree(async()=>{ throw new Error()});
  console.log('Do not care the error above. Just run!');
})();

API

carefree(fn: AsyncFunction | Function | Promise): Promise<Error|null>