UNPKG

require-node-example

Version:

An example for how to use npm package: require-node & require-node-loader

12 lines (9 loc) 303 B
'use strict' /** * Tries to execute a function and discards any error that occurs. * @param {Function} fn - Function that might or might not throw an error. * @returns {?*} Return-value of the function when no error occurred. */ module.exports = function(fn) { try { return fn() } catch (e) {} }