I am a beginner to Browserify for NodeJS and I wrote a simple module that would list the network interfaces and return it to the person viewing a webpage. I begun by writing the main.js file,
var os = require("os");
document.write(os.networkInterfaces());
Then I compiled the code via this command browserify main.js -o bundle.js which on completion didn't yield any output but resulted in the creation of bundle.js. This is when the html code comes into play,
<html>
<body>
Hi, here are your network interfaces:
<script src="bundle.js"></script>
</body>
</html>
Upon loading the page it says, Hi, here are your network interfaces:[object Object] when I was expecting a string that NodeJS says it's os.networkInterfaces() function returns when called. What did I do wrong and how can I go about fixing it?