summaryrefslogtreecommitdiff
path: root/src/lbaselib.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lbaselib.js')
-rw-r--r--src/lbaselib.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lbaselib.js b/src/lbaselib.js
index 4d0fb9c..931a285 100644
--- a/src/lbaselib.js
+++ b/src/lbaselib.js
@@ -26,7 +26,9 @@ const luaB_print = function(L) {
lapi.lua_pop(L, 1);
}
- console.log(lobject.jsstring(str));
+ // Don't use console.log if Node
+ if (process.stdout) process.stdout.write(lobject.jsstring(str) + "\n");
+ else console.log(lobject.jsstring(str));
return 0;
};