Skip to content

Commit 6ecc055

Browse files
committed
update lambda-env
1 parent adaa5a5 commit 6ecc055

File tree

3 files changed

+34
-26
lines changed

3 files changed

+34
-26
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
"main": "dist/main.js",
99
"files": [
1010
"dist/**/*",
11-
"tools/**/*"
11+
"scripts/**/*"
1212
],
1313
"bin": {
1414
"bootstrap": "dist/main.js",
15-
"process-info": "tools/process-info.cjs"
15+
"lambda-env": "scripts/lambda-env.cjs"
1616
},
1717
"scripts": {
1818
"build": "webpack",

scripts/lambda-env.cjs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
const env = {
4+
pid: process.pid,
5+
title: process.title,
6+
arch: process.arch,
7+
platform: process.platform,
8+
env: process.env,
9+
version: process.version,
10+
versions: process.versions,
11+
features: process.features,
12+
release: process.release,
13+
argv: process.argv,
14+
execArgv: process.execArgv,
15+
execPath: process.execPath,
16+
cwd: process.cwd(),
17+
};
18+
19+
console.error(`Lambda Environment:\n`, JSON.stringify(env, null, 2));
20+
21+
if (process.env.AWS_LAMBDA_RUNTIME_API) {
22+
console.log(
23+
JSON.stringify(
24+
{
25+
statusCode: 200,
26+
body: JSON.stringify(env, null, 2),
27+
},
28+
null,
29+
2
30+
)
31+
);
32+
}

tools/process-info.cjs

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)