New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@orikami/micro-to-lambda

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orikami/micro-to-lambda - npm Package Compare versions

Comparing version

to
1.2.1

8

index.js

@@ -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()
}
});
}
}

4

package.json
{
"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