All Projects → flesch → node-lambda-babel-template

flesch / node-lambda-babel-template

Licence: MIT License
A minimal template for an ES2015+ Node.js app running on AWS Lambda (w/ babel and webpack).

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-lambda-babel-template

Bref
Serverless PHP on AWS Lambda
Stars: ✭ 2,382 (+5855%)
Mutual labels:  lambda, aws-lambda
shim
HTTP Handler shim for Go projects running on AWS Lambda
Stars: ✭ 64 (+60%)
Mutual labels:  lambda, aws-lambda
Serverless Sinatra Sample
Demo code for running Ruby Sinatra on AWS Lambda
Stars: ✭ 195 (+387.5%)
Mutual labels:  lambda, aws-lambda
Serverlessish
Run the same Docker images in AWS Lambda and AWS ECS
Stars: ✭ 177 (+342.5%)
Mutual labels:  lambda, aws-lambda
Babel Plugin Transform Scala Lambda
Enable Scala lambda style
Stars: ✭ 53 (+32.5%)
Mutual labels:  babel, lambda
Micro Aws Lambda
A 7KB and 0 dependencies AWS Lambda library which supports middleware and easy debug.
Stars: ✭ 181 (+352.5%)
Mutual labels:  lambda, aws-lambda
Serverless Chrome
🌐 Run headless Chrome/Chromium on AWS Lambda
Stars: ✭ 2,625 (+6462.5%)
Mutual labels:  lambda, aws-lambda
Zappa
Serverless Python
Stars: ✭ 11,859 (+29547.5%)
Mutual labels:  lambda, aws-lambda
Serverless Plugin Typescript
Serverless plugin for zero-config Typescript support
Stars: ✭ 611 (+1427.5%)
Mutual labels:  babel, aws-lambda
Lambdium
headless chrome + selenium webdriver in AWS Lambda using the serverless application model
Stars: ✭ 246 (+515%)
Mutual labels:  lambda, aws-lambda
Es2017 Lambda Boilerplate
AWS Lambda boilerplate for Node.js 6.10, adding ES2018/7/6 features, Docker-based unit testing and various CI/CD configurations
Stars: ✭ 169 (+322.5%)
Mutual labels:  lambda, aws-lambda
Serverless Plugin Optimize
Bundle with Browserify, transpile and minify with Babel automatically to your NodeJS runtime compatible JavaScript
Stars: ✭ 122 (+205%)
Mutual labels:  babel, aws-lambda
Laravel Bridge
Package to use Laravel on AWS Lambda with Bref
Stars: ✭ 168 (+320%)
Mutual labels:  lambda, aws-lambda
Components
The Serverless Framework's new infrastructure provisioning technology — Build, compose, & deploy serverless apps in seconds...
Stars: ✭ 2,259 (+5547.5%)
Mutual labels:  lambda, aws-lambda
Aws Lambda Wkhtmltopdf
Convert HTML to PDF using Webkit (QtWebKit) on AWS Lambda
Stars: ✭ 165 (+312.5%)
Mutual labels:  lambda, aws-lambda
Apilogs
Easy logging and debugging for Amazon API Gateway and AWS Lambda Serverless APIs
Stars: ✭ 216 (+440%)
Mutual labels:  lambda, aws-lambda
Serverless Next.js
⚡ Deploy your Next.js apps on AWS Lambda@Edge via Serverless Components
Stars: ✭ 2,977 (+7342.5%)
Mutual labels:  lambda, aws-lambda
List Lambdas
Enumerate Lambda functions across all regions with useful metadata 💡💵⚙
Stars: ✭ 156 (+290%)
Mutual labels:  lambda, aws-lambda
Algnhsa
AWS Lambda Go net/http server adapter
Stars: ✭ 226 (+465%)
Mutual labels:  lambda, aws-lambda
Babel Plugin Partial Application
[DEPRECATED] Please use https://github.com/citycide/param.macro
Stars: ✭ 60 (+50%)
Mutual labels:  babel, lambda

node-lambda-babel-template

NPM version Dependencies Dev-dependencies Known Vulnerabilities Build Status

This project adds webpack and Babel to @motdotla's node-lambda-template so you can run the lastest version of Javascript on AWS Lambda.

babel-preset-latest is automatically included, but you can easily add additional presets and plugins.

webpack transforms index.js outputting to dist/index.js, which is then pushed up to AWS Lambda with node-lambda.

Getting Started

To get started, download the latest template files:

$ curl -o- https://ribjyr1g9l.execute-api.us-east-1.amazonaws.com/nodelambdababeltemplate/latest | bash

Before running the command above, please take a look at https://ribjyr1g9l.execute-api.us-east-1.amazonaws.com/nodelambdababeltemplate/latest directly. Piping anything unknown through bash can be dangerous!

The install script is created using this: https://gist.github.com/flesch/8ed6f47942350e858ebd3283e10f8a9b.

To download a specific release, use the following:

$ curl -o- https://ribjyr1g9l.execute-api.us-east-1.amazonaws.com/nodelambdababeltemplate/v2.1.0 | bash

Or clone this repository and remove the .git folder.

$ git clone --depth 1 https://github.com/flesch/node-lambda-babel-template.git && cd node-lambda-babel-template && rm -rf .git

Next, install the dependencies.

$ npm install

The postinstall npm hook will run node-lambda setup, giving you the context.json, event.json, .env, and deploy.env files.

See https://github.com/motdotla/node-lambda#setup for more details.

Note: AWS_ENVIRONMENT and AWS_HANDLER are defined in the npm scripts in package.json, not .env.

Developing

webpack will watch index.js and transform it as dist/index.js while you make changes.

$ npm start

Modify webpack.config.js and .babelrc to add addtional plugins and presets.

You can test your changes by running:

$ npm test

Modify event.json to mock your event.

Deploying

To deploy your compiled index.js to AWS Lambda, simply run:

$ npm run deploy

The predeploy npm hook will recompile index.js using Webpack in production mode. node-lambda deploy is then executed, including deploy.env.

See Also

License

(The MIT License)

Copyright (c) 2016 John Flesch.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].