@nxicy/node-lambda
v0.5.3
Published
[![npm](https://img.shields.io/npm/v/@nxicy%2Fnode-lambda.svg?style=flat)](hhttps://www.npmjs.com/package/@nxicy/node-lambda) [![nx support](https://img.shields.io/badge/NX->=16.6.0-143055?)](https://nx.dev)
Downloads
4
Readme
@nxicy/node-lambda
The Node-Lambda Plugin contains generators and executors to simplify the creation and management of applications and handlers specifically designed for AWS Lambda deployment.
Overview
Setting up Node-Lambda
To add the Node-Lambda plugin to an existing workspace, run the following:
npm i @nxicy/node-lambda --save-dev
Creating Applications
You can add a new application with the following:
nx g @nxicy/node-lambda:application my-node-lambda-app
Creating Handlers
You can add a new handler to application with the following:
nx g @nxicy/node-lambda:handler --project my-node-lambda-app --name my-node-lambda-handler
Using Node-Lambda
Testing Handlers
You can run unit tests with:
nx run my-node-lambda-app:test
Building Handlers
Node-lambda handlers can be built with:
nx run my-node-lambda-app:build-my-node-lambda
Packaging Handlers
Build and package a handler into a zip for deployment using:
nx run my-node-lambda-app:package-my-node-lambda
Executors
package Builds and packages a handler
Generators
application Create a node-lambda application
handler Create a node-lambda handler
@nxicy/node-lambda:package
Builds and packages a handler to be deployed to as an AWS lambda
Options can be configured in project.json
when defining the executor, or when invoking it.
Options
buildTarget required
string
The target to run to build you the app.
buildTargetOptions
object
Default:{}
Additional options to pass into the build target.
zipFileOutputPath string The path of the zip file
@nxicy/node-lambda:application
Node-lambda Application Options Schema
Usage
nx g @nxicy/node-lambda:application ...
or
nx g @nxicy/node-lambda:app ...
Options
name required
string
The name of the application
directory string The directory of the new application.
skipFormat
boolean
Default: false
Skip formatting files
linter
string
Default: eslint
Accepted values: eslint
The tool to use for running lint checks.
unitTestRunner
string
Default: jest
Accepted values: jest,none
Test runner to use for unit tests.
tags string Add tags to the application (used for linting).
setParserOptionsProject
boolean
Default: false
Whether or not to configure the ESLint parserOptions.project
option. We do not do this by default for lint performance reasons.
bundler
string
Default: esbuild
Accepted values: esbuild,webpack
Bundler which is used to package the handler
@nxicy/node-lambda:handler
Node-lambda Handler Options Schema
Usage
nx g @nxicy/node-lambda:handler ...
or
nx g @nxicy/node-lambda:hdlr ...
Options
name required
string
The name of the handler
project required
string
Then project name the handler will be added to
bundler
string
Default: esbuild
Accepted values: esbuild,webpack
Bundler which is used to package the handler