I am trying to use module.exports()
to create a new module in my NW.js application.
I have two files that I am using:
Index.js
const gkm = require('gkm'); //This is a key listener
const AudioStreamMeter = require('audio-stream-meter'); //This is a mic listener
const exportable = require("./twitchAuth.js");
exportable.test();
// More code under this
twitchAuth.js
function doSomething() {
document.getElementById("volume").style.backgroundColor = "#FFF";
}
module.exports(doSomething);
only thing is that when I add const exportable = require("./separateFile.js");
to index.js
then gkm
and audio-stream-meter
stop working as well as the rest of my code.