How to use the ffi-napi.errno function in ffi-napi

To help you get started, we’ve selected a few ffi-napi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hertzg / node-net-keepalive / lib / ffi-bindings.js View on Github external
const setsockopt = (fd, level, name, value, valueLength) => {
  const err = ffi.setsockopt(fd, level, name, value, valueLength)

  if (err !== 0) {
    let errno = FFI.errno()
    throw Commons.errnoException(errno, 'setsockopt')
  }

  return true
}

ffi-napi

A foreign function interface (FFI) for Node.js, N-API style

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis