17

I'm using AWS SAM and running against Node 10.x.

Would love to pass in the flags for experimental modules and top level await.

Thanks!

1
  • 1
    I am interested in this too now. AWS Lambda is getting more proactive at supporting the latest versions of Node.js and being able to use "Harmony" flags at some point would be useful. Especially with Optional Chaining and Nullish Coalescing now supported Node 13 and Node 14 with --harmony-optional-chaining and --harmony-nullish. Commented Nov 24, 2019 at 13:39

1 Answer 1

8

You can add Node.js command line options to lambda by setting the NODE_OPTIONS environment variable.

https://nodejs.org/api/cli.html#cli_node_options_options

Sign up to request clarification or add additional context in comments.

1 Comment

I tried doing this in template.yaml file, It didn't work for me. Type: AWS::Serverless::Function Properties: CodeUri: functions/stock-checker/ Handler: app.lambdaHandler Runtime: nodejs12.x Environment: Variables: NODE_OPTIONS: "--experimental-modules"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.