require('xyz')() -- This is good. Now storing this in var: const abc = require('xyz'); abc() But this is not working.