/babel-preset-aws-lambda

A babel preset for transforming your JavaScript for Lambda Functions

Primary LanguageJavaScriptMIT LicenseMIT

babel-preset-aws-lambda

Babel preset for AWS λ functions

This preset currently transforms code to be compatible with node versions of amazon AWS lambda funcions.

Install

$ npm install --save-dev babel-preset-aws-lambda

Usage

Via .babelrc (Recommended)

.babelrc

{
  "presets": ["aws-lambda"]
}

Via CLI

$ babel script.js --presets aws-lambda

Via Node API

require("babel-core").transform("code", {
  presets: ["aws-lambda"]
});

Targeting Environments

This module uses babel-preset-env to target specific environments.

Please refer to babel-preset-env#targets for a list of available options.

You may override our default list of targets by providing your own targets key.

{
  "presets": [["aws-lambda", {
    "targets": {
      "node": 4
    }
  }]]
}

To enable debug mode, set the debug key to true.

{
  "presets": [["aws-lambda", {
    "debug": true
  }]]
}