Let's say I have too files, library, and main
content of library:
exports.someVariable = 5;
content of main:
var library = require('path/to/library')
print(library.someVariable) // correctly prints 5
But let's say I want to also use someVariable in library, maybe something like this:
content of library:
exports.someVariable = 5;
exports.someOtherVariable = someVariable+3; //will say it doesn't exist in this scope
What I tried content of library:
var someVariable = 5;
var someOtherVariable = someVariable+3; //it works so far
exports.someVariable;
exports.someOtherVariable;
content of main:
var library = require('path/to/library')
print(library.someVariable) // undefined
print(library.someOtherVariable) // undefined
Any suggestions?