laconbass laconbass - 2 years ago 262
Javascript Question

Nodejs: What does `process.binding` mean?

I've seen

many times while researching through the node.js source code on github.

Can anybody explain me what this function does?

Answer Source

This function returns internal module, like require. It's not public, so you shouldn't rely on it in your code, but you can use it to play with node's low level objects, if you want to understand how things work.

For example, here timer_wrap binding is registered. It exports Timer constructor. In lib/timers.js it's imported

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download