in ruby I can:

```
require 'timeout'

Timeout.timeout 10 do
# do smth > 10 seconds
end

```

it will raise timeout error to avoid code lock, how to do same thing in nodejs, nodejs #setTimeout doesn't fit my need

one case is, when i http.get timeout(for ex, netowrk is unstable), I should set timeout and handle the failed get request, I hope impl #timeout, how should i do?

```
try {
  timeout(10, function () {
    http.get("example.com/prpr")
  })
} catch (e) {
  if (e.message == "timeout") {
    // do smth
  } else {
    throw e
  }
}

```