I have an Electron application, and need a feature like module.exports
. But it seems like it's not supported.
If I try,
index.js
const helper = require('./helper')
let importantVar = helper.getImportantVar
helper.js
function getImportantVar() {
let foo = 'bar'
return foo
}
module.exports = {
getImportantVar: getImportantVar
}
I get,
Uncaught Error: Cannot find module 'helper'
Any idea how I can proceed with this, to get the same functionality.
using electron: 6.0.12