Files
node-dtrace-provider/libusdt-arch.js
T
Chris Andrews 622ba1c819 Use node indicated by npm, and fall back to 0.6.x process.arch.
We were always using node from the path, rather than respecting the
$npm_config_prefix variable.

We also used the 'process.config' object, which isn't available until
node v0.8.x, so we now fall back on process.arch in that case.
2012-11-02 18:29:18 +00:00

14 lines
331 B
JavaScript

// Output the architecture of this node build, either 'i386' or
// 'x86_64'
//
// This copes with both node 0.6.x and 0.8.x.
try {
// node 0.8
console.log(process.config.variables.target_arch == 'x64' ? 'x86_64' : 'i386')
}
catch (TypeError) {
// node 0.6
console.log(process.arch == 'x64' ? 'x86_64' : 'i386')
};