I'm trying to use scala.js + nw.js to write some application, and will use some node modules in scala.js. But I'm not sure how to do it.
Say, there is module fs
and I can write such code in Javascript:
var fs = require('fs');
fs.writeFile("/tmp/test", "Hey there!", function(err) {
if(err) {
console.log(err);
} else {
console.log("The file was saved!");
}
});
But how to do the same in scala.js from scratch?