app.js:
var script = require('./script'); script.testJs(); script.js:
function testJs() { //... }; app.js and script.js are in the same folder. By doing
script.testJs(); TypeError , Message: script.testJs error is not a function . What's wrong? Add. Information: using Visual Studio Code, jsconfig.json:
{ "compilerOptions": { "target": "ES6" }, "exclude": [ "node_modules" ], "files": [ "~/" ] }