{"id":25754013,"url":"https://github.com/morrissinger/lambda-base","last_synced_at":"2026-06-11T06:31:07.331Z","repository":{"id":148747998,"uuid":"103710698","full_name":"morrissinger/lambda-base","owner":"morrissinger","description":"AWS Lambda base project.","archived":false,"fork":false,"pushed_at":"2018-03-21T15:09:28.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T15:38:49.766Z","etag":null,"topics":["aws-lambda","base-project","es2017"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/morrissinger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-15T23:54:28.000Z","updated_at":"2020-02-04T13:07:11.000Z","dependencies_parsed_at":"2023-05-28T20:00:12.218Z","dependency_job_id":null,"html_url":"https://github.com/morrissinger/lambda-base","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/morrissinger/lambda-base","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morrissinger%2Flambda-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morrissinger%2Flambda-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morrissinger%2Flambda-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morrissinger%2Flambda-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morrissinger","download_url":"https://codeload.github.com/morrissinger/lambda-base/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morrissinger%2Flambda-base/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34186385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","base-project","es2017"],"created_at":"2025-02-26T15:30:02.516Z","updated_at":"2026-06-11T06:31:07.326Z","avatar_url":"https://github.com/morrissinger.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![NodeJs Lambda](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/images/code-samples-lambda.png)\n\n# Lambda Base\n\nA base project for developing functions for [Amazon Web Services](http://aws.amazon.com) [Lambda](https://aws.amazon.com/lambda/). This is\nset up to allow development in the ECMAScript2017, using many of the latest\nlanguage features, whether or not supported by the Lambda runtime, and includes\na number of tools that are useful when developing Lambda functions.\n\n## Why this Exists\n\nAs I began to develop more interesting Lambda functions, I found that I needed\na more full assortment of features available by-default. Transpiling from\nEC2017 was an early initial requirement, which led me to install Babel. At that\npoint, I needed a build system, which led me to install Gulp. I needed to be\nable to do test-driven development of my work, which led to a number of\nadditional development dependencies. I wanted clean code, requiring ESLint.\nFinally, I wanted to automate the task of packaging up the code for deployment\ninto Lambda.\n\nThis base embodies a number of opinions, but it shouldn't be too much trouble\nto make modifications to the setup if your opinions should be different.\n\n## Getting Started\n\nTo get started, you must install dependencies using `npm`:\n\n```sh\nnpm install\n```\n\nYou should also have the [Gulp](https://gulpjs.com/) CLI installed globally:\n\n```sh\nnpm install -g gulp-cli\n```\n\nTo run the Lambda, use `npm`:\n\n```sh\nnpm start\n```\n\n## Workflow\nGeneral workflow is write code -\u003e build -\u003e test -\u003e trigger -\u003e package.\n\nBuild lambda into compatible JavaScript for Lambda runtime:\n```sh\nnpm run build\n```\n\nRun tests:\n```sh\nnpm test\n```\n\nTrigger the lambda locally, providing optional JSON for event and context\narguments:\n```sh\ngulp trigger --event=\"$(cat myEventJson.json)\" --context=\"$(cat myContextJson.json)\"\n```\n\nPackage the lambda into a zip file that can be uploaded to S3 and specified\nduring Lambda creation using the AWS management console or CLI:\n```sh\nnpm run package\n```\n\n## Features\n\nThe base project contains a number of useful features, as follows.\n\n### ECMAScript2017 via Babel\nBabel is included by default, with ES17 code going in the `./src` directory, with\nthe transpiled target in `./lib`. You can control which language features you\nallow via the `.babelrc` file. You can transpile using NPM:\n\n```sh\nnpm run build\n```\n\n\n### ESlint\nEven Lambda functions should be free from lint! [ESLint](https://eslint.org) works out of the box:\n\n```sh\nnpm run lint\n```\n\nBy default, the `.eslintrc.json` file is configured for the [AirBnB Style Guide](https://github.com/airbnb/javascript).\n\n### Gulp\nYou should generally build, test, and package using `npm` because the scripts\ndefined there are responsible for setting the correct Node environment per\nphase. However, if you are interested in the task definitions, they are defined\nhere.\n\nGulp tasks are organized in the `./tasks` directory, and included in via the\nbase `gulpfile.babel.js`. You can author tasks using ES2017 and Gulp is\nconfigured to be able to understand everything, including `import` statements.\n\nIncluded tasks fall into three categories: (i) building (or transpiling); (ii)\ntesting; and (iii) packaging for Lambda. The following is a description of all\navailable tasks:\n\n#### Building\n1. `build-babel`: Transpile all ES17 in `./src` into the `./lib` target,\nrecursively.\n2. `build-assets`: Copy all additional assets from `./src` into the `./lib`\ntarget, recursively.\n3. `build-clean`: Remove the `./lib` directory, cleaning the target.\n4. `build`: Combination of (1) and (2), above.\n\n#### Testing\n1. `test`: Run all tests in the `./test` directory.\n2. `watch`: Watch the source directory for changes and continually re-run tests\nautomatically.\n\n#### Packaging\n1. `package-build`: Organize all files needed for upload to Lambda into the\n`./pkg` target.\n2. `package-zip`: Zip all files in the `./pkg` target into `lambda.zip` at the\nroot of the project.\n3. `package-clean`: Remove the `./pkg` directory, cleaning the target.\n4. `package-remove`: Remove the `lambda.zip` file, if it exists.\n5. `package`: Combination of (1), (2), and (3), above, in order.\n\n### Testing\nTests run in the [Ava](https://github.com/avajs/ava) test runner. [Sinon](http://sinonjs.org/),\nand [Babel-Plugin-Rewire](https://github.com/speedskater/babel-plugin-rewire) are\navailable in the project by default.\n\nA Sinon spy can be fed to the Lambda function as the callback during unit\ntests, and Rewire can be used to monkey-patch external dependencies (including)\nother AWS services that your Lambda function would ordinarily have access to\nIAM roles in production. This makes it possible to fully unit test Lambda\nfunctions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorrissinger%2Flambda-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorrissinger%2Flambda-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorrissinger%2Flambda-base/lists"}