lambda-node-starter
Advanced tools
+6
-1
| { | ||
| "name": "lambda-node-starter", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "An AWS Lambda function Node.js webpack environment", | ||
@@ -12,2 +12,7 @@ "main": "index.js", | ||
| }, | ||
| "homepage": "https://github.com/Wowguagua/webpack-aws-lambda-env#readme", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/Wowguagua/webpack-aws-lambda-env.git" | ||
| }, | ||
| "author": "wowguagua", | ||
@@ -14,0 +19,0 @@ "license": "ISC", |
+6
-76
| # Webpack AWS Lambda Environment | ||
| ## Starter | ||
| ## Lambda Environment Starter | ||
| This package is the command to create AWS Lambda node.js environment. | ||
| ``` | ||
| npx lambda-node-starter your-lambda-function-name | ||
| npx lambda-node-starter my-lambda-function | ||
| cd my-lambda-function | ||
| npm install | ||
| ``` | ||
| ## Develop | ||
| Start writing your lambda function at: `src/index.js` | ||
| ``` | ||
| npm run dev | ||
| ``` | ||
| Build the bundle file in development mode. | ||
| ## Debug | ||
| ``` | ||
| npm run watch | ||
| ``` | ||
| webpack can watch files and recompile | ||
| ### Configure test event | ||
| ``` | ||
| /** | ||
| * test.js | ||
| */ | ||
| const Main = require('./build/index'); | ||
| const test = async () => { | ||
| const event = { | ||
| "key1": "value1", | ||
| "key2": "value2", | ||
| "key3": "value3" | ||
| } | ||
| await Main.handler(event); | ||
| }; | ||
| test(); | ||
| ``` | ||
| ### Environment | ||
| Add .env in the root and add environment if you want. | ||
| ``` | ||
| /** | ||
| * .env | ||
| */ | ||
| AWS_REGION={YOUR_AWS_REGION} | ||
| AWS_ACCESS_KEY_ID={YOUR_AWS_ACCESS_KEY_ID} | ||
| AWS_SECRET_ACCESS_KEY={YOUR_AWS_SECRET_ACCESS_KEY} | ||
| ``` | ||
| ### Test your event | ||
| ``` | ||
| npm run test | ||
| ``` | ||
| ## Build | ||
| ``` | ||
| npm run build | ||
| ``` | ||
| Will build the bundle js file and .zip file in `build` folder. | ||
| ### Deploy | ||
| Upload .zip file to your lambda function. | ||
| <br> | ||
| if you have aws cli, add the `FUNCTION_NAME` in your environment. Environment may look like this | ||
| ``` | ||
| /** | ||
| * .env | ||
| */ | ||
| AWS_REGION={YOUR_AWS_REGION} | ||
| AWS_ACCESS_KEY_ID={YOUR_AWS_ACCESS_KEY_ID} | ||
| AWS_SECRET_ACCESS_KEY={YOUR_AWS_SECRET_ACCESS_KEY} | ||
| FUNCTION_NAME={YOUR_LAMBDA_FUNCTION_NAME} | ||
| ``` | ||
| deploy your function by using aws cli | ||
| ``` | ||
| npm run deploy | ||
| ``` | ||
| ## Others | ||
| Setting the AWS Credentials. [Link](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html) | ||
| <br> | ||
| Setting the AWS Region. [Link](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-region.html) | ||
| [Watching on github](https://github.com/Wowguagua/webpack-aws-lambda-env#readme) |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
-100%3
-25%7013
-13.62%10
-87.5%