Skip to content

Commit

Permalink
feat: export getLambdaEnv function for programattic use
Browse files Browse the repository at this point in the history
  • Loading branch information
joelcox22 committed Mar 18, 2023
1 parent 7fbae39 commit 651d921
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.1.3",
"description": "Run a process with environment variables from an AWS Lambda function",
"private": false,
"main": "index.js",
"main": "lib/index.js",
"scripts": {
"build": "projen build",
"lint": "projen lint",
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { getLambdaEnv } from './use-lambda-env';
2 changes: 1 addition & 1 deletion src/use-lambda-env.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as cp from 'child_process';
import * as lambda from '@aws-sdk/client-lambda';

async function getLambdaEnv(functionName: string, region?: string): Promise<NodeJS.ProcessEnv> {
export async function getLambdaEnv(functionName: string, region?: string): Promise<NodeJS.ProcessEnv> {
const clientOptions: lambda.LambdaClientConfig = {};
if (typeof region === 'string') {
clientOptions.region = region;
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "lib",
"rootDir": "src"
"rootDir": "src",
"declaration": true
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2058,10 +2058,10 @@ anymatch@^3.0.3:
normalize-path "^3.0.0"
picomatch "^2.0.4"

app-root-path@*:
version "3.0.0"
resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-3.0.0.tgz#210b6f43873227e18a4b810a032283311555d5ad"
integrity sha512-qMcx+Gy2UZynHjOHOIXPNvpf+9cjvk3cWrBBK7zg4gH9+clobJRb9NGzcT7mQTcV/6Gm/1WelUtqxVXnNlrwcw==
app-root-path@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-3.1.0.tgz#5971a2fc12ba170369a7a1ef018c71e6e47c2e86"
integrity sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==

aproba@^1.0.3:
version "1.2.0"
Expand Down

0 comments on commit 651d921

Please sign in to comment.