Installations
npm install @silvermine/lambda-express
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
16.15.0
NPM Version
8.5.5
Score
76.3
Supply Chain
93.6
Quality
79.3
Maintenance
25
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Languages
TypeScript (99.04%)
JavaScript (0.96%)
Developer
silvermine
Download Statistics
Total Downloads
50,980
Last Day
26
Last Week
293
Last Month
1,355
Last Year
9,316
GitHub Statistics
8 Stars
155 Commits
9 Forks
5 Watching
5 Branches
9 Contributors
Bundle Size
51.34 kB
Minified
17.53 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.3.1
Package Id
@silvermine/lambda-express@0.3.1
Unpacked Size
384.30 kB
Size
72.22 kB
File Count
127
NPM Version
8.5.5
Node Version
16.15.0
Publised On
09 Feb 2023
Total Downloads
Cumulative downloads
Total Downloads
50,980
Last day
-69%
26
Compared to previous day
Last week
-19.3%
293
Compared to previous week
Last month
51.2%
1,355
Compared to previous month
Last year
8.5%
9,316
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
29
Lambda Express
What?
An express-like framework for use with AWS Lambda functions that supports both API Gateway and Application Load Balancer integrations with Lambda.
The entire library is written in TypeScript so you get great autocomplete if you're using VS Code or similar. It's also very well tested, so you can rest assured that it will do what you need, and regressions between versions will be rare.
Why?
You shouldn't have to think about how API Gateway or Application Load Balancer send you request events, or how you need to respond to them with your responses. There are a lot of little intricacies, especially if you are using API Gateway for some of your APIs and Application Load Balancer for others (see this writeup for the differences).
If you're writing APIs, you've probably already written Express apps, so keeping things familiar will accelerate your development, allowing you to focus on your business logic.
Usage
Here's a simple example to get you up and running quickly (assumes your execution environment is Node 12.x):
npm i @silvermine/lambda-express
npm i -D aws-lambda
1import { Application, Response, Request } from '@silvermine/lambda-express'; 2import { RequestEvent } from '@silvermine/lambda-express/dist/types/request-response-types'; 3import { NextCallback } from '@silvermine/lambda-express/dist/types/interfaces'; 4import { Context, Callback } from 'aws-lambda'; 5 6const app = new Application(); 7 8app.all('/*', (_request: Request, response: Response, next: NextCallback) => { 9 response.set('Access-Control-Allow-Origin', '*'); 10 next(); 11}); 12 13app.options('/*', (_request: Request, response: Response) => { 14 response.set('Access-Control-Allow-Methods', 'OPTIONS,GET') 15 .set('Access-Control-Allow-Credentials', 'false'); 16 response.send(''); 17}); 18 19app.get('/my-endpoint', async (request: Request, response: Response) => { 20 response.send('Hello world!'); 21}); 22 23export const handler = (event: RequestEvent, context: Context, callback: Callback): void => { 24 app.run(event, context, callback); 25}; 26 27export default handler;
At this point you should be able to compile, bundle, and deploy this Lambda. Assuming you have configured APIGW or ALB to forward traffic to your Lambda, you will now have a very basic working API!
License
This software is released under the MIT license. See the license file for more details.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 11/12 approved changesets -- score normalized to 9
Reason
5 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/silvermine/lambda-express/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/silvermine/lambda-express/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/silvermine/lambda-express/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/silvermine/lambda-express/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/silvermine/lambda-express/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/silvermine/lambda-express/ci.yml/master?enable=pin
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 2 out of 2 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 29 are checked with a SAST tool
Reason
37 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-j383-35pm-c5h4
- Warn: Project is vulnerable to: GHSA-rm36-94g8-835r
- Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6
- Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9
- Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f
- Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p
- Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv
- Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8
- Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65
- Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-7xcx-6wjh-7xp2
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
4.4
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More