I'm trying to invoke this function, in /file-name.js
'use strict';
exports.handler = (event, context, callback) => {
console.log('INFO: Hello World!!');
};
And this is how i am invoking it from /test/tester.js
var myFunc = require('../file-name.js');
myFunc(event, context, callback);
But i get this error:
TypeError: myFunc is not a function
PS: event, context and callback parameters was defined and are ok. PS2: i can't change file-name.js. PS3: Finally work like this (thanks to @ankit31894):
var myFunc = require('../file-name.js');
myFunc.handler(event, context, callback)