Search code examples
javascriptnode-postgres

Can JavaScript run C without any configurations?


In the description of the node-postgres package, there is a sentence: "Pure JavaScript and optional native libpq bindings."

Does that mean that I can run C code from JavaScript? Or "bindings" here means something else?


Solution

  • That sentence means there are native libpq <-> Node.js bindings available.

    You can run C (or other compiled) code in Node.js (and Deno probably too), but not in browsers etc. without compiling that code to e.g. WebAssembly.