@orikami/micro-to-lambda
Advanced tools
Comparing version 1.1.0-rc1 to 1.2.1
@@ -68,3 +68,3 @@ var Stream = require('stream'); | ||
callback(new Error("Did not promise to close database connection")) | ||
process.exit(); | ||
return | ||
} | ||
@@ -78,13 +78,7 @@ | ||
callback(null,res.toLambdaResponse()) | ||
if (!keepAlive) { | ||
process.exit(); | ||
} | ||
}) | ||
.catch(err => { | ||
callback(err); | ||
if(!keepAlive) { | ||
process.exit() | ||
} | ||
}); | ||
} | ||
} |
{ | ||
"name": "@orikami/micro-to-lambda", | ||
"version": "1.1.0-rc1", | ||
"version": "1.2.1", | ||
"description": "", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"peerDependencies": { | ||
"micro": "^8.0.0" | ||
"micro": "*" | ||
}, | ||
@@ -15,0 +15,0 @@ "dependencies": { |
@@ -25,7 +25,20 @@ # micro-to-lambda | ||
If you're using `async` or `await` syntax, it is recommended to use the | ||
`async-to-gen` helper to make code compatible for node 6.10.x | ||
By default, the lambda will terminate the process after every request. | ||
If you want to keep the process alive, use: | ||
``` | ||
microToLambda(handler, { keepAlive: true, iPromiseToCloseDatabaseConnections: true }) | ||
``` | ||
As you can see, you have to promise to close all database connections (to MongoDB). Otherwise, the autoscaling of lambda can cause trouble for the connection limit of the database. | ||
```javascript | ||
require("async-to-gen/register"); | ||
``` | ||
## Changelog | ||
1.2.0 - Remove process.exit() to fix error. | ||
1.1.1 - Close AWS Lambda after every process. (HAS ERRORS) | ||
0.0.01 - Initial release |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3909
0
2
44
0
74