lambda-node-starter
Advanced tools
+40
-1
@@ -22,4 +22,5 @@ #!/usr/bin/env node | ||
| } | ||
| console.log('make directory...'); | ||
| fs.mkdirSync(root); | ||
| console.log('make directory...'); | ||
| console.log('add package.json...'); | ||
| fs.writeFileSync( | ||
@@ -29,2 +30,11 @@ path.join(root, 'package.json'), | ||
| ); | ||
| console.log('add .env...'); | ||
| fs.writeFileSync( | ||
| path.join(root, '.env'), | ||
| makeEnvironment() + os.EOL | ||
| ); | ||
| fs.writeFileSync( | ||
| path.join(root, '.gitignore'), | ||
| makeGitIgnore() + os.EOL | ||
| ); | ||
| console.log('copy the template...'); | ||
@@ -67,2 +77,31 @@ // To copy a folder or file | ||
| function makeEnvironment() { | ||
| return 'AWS_REGION={YOUR_AWS_REGION}\nAWS_ACCESS_KEY_ID={YOUR_AWS_ACCESS_KEY_ID}\nAWS_SECRET_ACCESS_KEY={YOUR_AWS_SECRET_ACCESS_KEY}\nFUNCTION_NAME={YOUR_LAMBDA_FUNCTION_NAME}' | ||
| } | ||
| function makeGitIgnore() { | ||
| return ( | ||
| ` | ||
| # dependencies | ||
| /node_modules | ||
| # production | ||
| /build | ||
| # misc | ||
| .env | ||
| .DS_Store | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| ` | ||
| ) | ||
| } | ||
| function copyTemplate(tempDir, root) { | ||
@@ -69,0 +108,0 @@ return new Promise((resolve, reject) => { |
+2
-3
| { | ||
| "name": "lambda-node-starter", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "An AWS Lambda function Node.js webpack environment", | ||
@@ -12,3 +12,2 @@ "main": "index.js", | ||
| }, | ||
| "keywords": [], | ||
| "author": "wowguagua", | ||
@@ -20,2 +19,2 @@ "license": "ISC", | ||
| } | ||
| } | ||
| } |
+4
-0
| # Webpack AWS Lambda Environment | ||
| ## Starter | ||
| ``` | ||
| npx lambda-node-starter your-lambda-function-name | ||
| ``` | ||
@@ -3,0 +7,0 @@ ## Develop |
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
8119
11.2%162
25.58%80
5.26%