From cb47dfa90e3bc6c02ee41715de560f620cbcc9e8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 7 Apr 2016 15:56:25 +0900 Subject: [PATCH] Fix problem with old Node --- tools/get-endianness.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/get-endianness.js b/tools/get-endianness.js index a1f985e18a0..a910e664b05 100644 --- a/tools/get-endianness.js +++ b/tools/get-endianness.js @@ -1 +1,6 @@ -console.log(require('os').endianness() === 'BE' ? 'big' : 'little') +var os = require('os') +if (os.endianness) { + console.log(require('os').endianness() === 'BE' ? 'big' : 'little') +} else { // Your Node is rather old, but I don't care. + console.log('little') +}