The context object also comes with its own methods that you can call to correctly terminate your function's executions such as, context.succed(), context.fail(), and context.done(). However, post April 2016, Lambda has transitioned the Node.js runtime from v0.10.42 to v4.3 which does support these methods. However, it encourages the use of callback() function for performing the same actions.
Here are some of the commonly used context object methods and properties described as follows:
getRemainingTimeInMillis(): It returns the number of milliseconds left for execution before Lambda terminates your function. This comes in really handy when you want to perform some corrective actions before your function exits or times out.
callbackWaitsForEmptyEventLoop: This property is used to override the default behavior of a callback() function, that is, to wait till the entire event loop is processed, and only then return back to the caller. If set to false, this property causes the callback() function to stop any further processing in the event loop even if there are any other tasks to be performed. The default value is set to true.
functionName: It returns the name of the executing Lambda function.
functionVersion: The current version of the executing Lambda function.
memoryLimitInMB: The amount of resource in terms of memory that is set for your Lambda function.
logGroupName: It returns the name of the CloudWatch Log group that stores the function's execution logs.
logStreamName: It returns the name of the CloudWatch Log stream that stores the function's execution logs.
awsRequestID: It returns the request ID associated with that particular function's execution.