Update to pass callback for nodejs4.3 runtime#74
Conversation
* Also output deprecation warning for older runtime
lib/main.js
Outdated
| succeed: function (result) { | ||
| console.log('succeed: ' + JSON.stringify(result)); | ||
| process.exit(0); | ||
| if(isNode43) console.log('context.succeed() is deprecated with Node.js 4.3 runtime'); |
There was a problem hiding this comment.
Could you rewrite this as if (isNode43) { and the corresponding } on a newline?
There was a problem hiding this comment.
It's also not entirely clear; it is deprecated, but can you still use it? Should we kill succeed/fail/done for anything isNode43?
There was a problem hiding this comment.
It is supported for backward compatibility: http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html#transition-to-new-nodejs-runtime
|
Would you mind updating https://github.com/motdotla/node-lambda/blob/master/README.md#run with this extra parameter as well? And perhaps make a note of what runtimes are currently available for both? Greatly appreciating this work so far! |
|
OK, I also changed the default runtime to |
|
@briandonahue That would be great actually, could you add a new paragraph below https://github.com/motdotla/node-lambda#custom-environment-variables ? |
|
Thanks @briandonahue! |
|
Sure thing - thanks to all the contributors, node-lambda has made playing with AWS Lambda stuff much easier! |
* Added package command to create a local zip. Exclude *.env files from being uploaded to amazon. Exclude .git* to exclude .gitignore. Exclude test from zip. Exclude packageDirectory from zip if specified. * added test for refactored _archive method. * Add -e to not escape \n when echo'ing * VpcConfig support: - http://docs.aws.amazon.com/lambda/latest/dg/API_VpcConfig.html - http://docs.aws.amazon.com/lambda/latest/dg/vpc.html This allows users to place their Lambda functions in specific subnets with specific security groups. * Use AWS API 2015-03-31: - Check if the function exists, if it does update else create new - This API provides compatibility with VpcConfig * Only ignore deploy.env by default * Updated readme: MODE is no longer a thing * Throw on failures * - Fix rsync namespaced error - Add editorconfig - Ignore editorconfig * Update to pass callback for nodejs4.3 runtime (#74) * Update to pass callback for nodejs4.3 runtime * Default to recommended runtime * Add note about runtimes * Added note on how to target v0.10.36 * Runhandler: Hotfixes * Runhandler: Hotfixes (#75) * Post install script second atttempt * Post install script * Add '-x' / '--excludeGlobs' args for general file exclusion on deploy. (2) (#80) This lets me e.g. exclude not only `.env` but by `.env.prod` / `.env.dev` and any other junky / sample files that happen to live in the method's directory. Or for that matter to move all those files into a sub- directory and exclude that. Less policy, more flexibility. * Excludes: Ignore *.swp (#81) * Ignore .swp files by default. Remove redundant deploy.env ignore from the examples. * Add option to create a sample file with a custom filename and fix the run command when running with a custom event file (#51) * Feature/context file (#82) * Add context.json example * Add contextFile -x --contextFile parameter * fix contextFile example filename * update setup log message * Runhandler: Hotfixes * Reformat to match existing whitespace * more reformating to match existing whitespace * revert version back to 0.7.1 * Fix indenting * Update changelog
Fixes #70 - Passing along runtime to
runmethod" and using a callback to handle success/fail/done scenarios. Added deprecation warning forcontext.[succeed,fail,done]()calls.