M
util.getSystemErrorMap
History
Added in: v16.0.0, v14.17.0
v16.0.0, v14.17.0
Introduced in: v0.10.0
v0.10.0
util.getSystemErrorMap(): Map
Returns:
MapReturns a Map of all system error codes available from the Node.js API. The mapping between error codes and error names is platform-dependent. See Common System Errors for the names of common errors.
fs.access('file/that/does/not/exist', (err) => { const errorMap = util.getSystemErrorMap(); const name = errorMap.get(err.errno); console.error(name); // ENOENT });