
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
lambda-compression
Advanced tools
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
This library provides a wrapper that can be used to compress content in responses when using the AWS HTTP API.
The library supports compression with br
, gzip
and deflate
. It will return responses with compressed data matching the supported accept-encoding
header provided by the client.
Simply add the lambda-compression
package to your project:
npm add lambda-compression
# when using Yarn
yarn add lambda-compression
This library provides only one method compress
that accepts two parameters with the respective types of APIGatewayProxyEventV2
and APIGatewayProxyStructuredResultV2
(for more details on these types, see TypeScript Types for AWS Lambda).
Simply call the compress
method as follows before returning the result of your Lambda.
import { compress } from 'lambda-compression';
import {
Handler,
APIGatewayProxyEventV2,
APIGatewayProxyResultV2,
} from 'aws-lambda';
type ProxyHandler = Handler<APIGatewayProxyEventV2, APIGatewayProxyResultV2>;
export const handler: ProxyHandler = async (event, context) => {
return compress(event, {
statusCode: 201,
headers: {
'Content-Type': 'application/json',
},
body: '{"data":"hello"}',
});
};
FAQs
HTTP payload compression for AWS Lambda functions
We found that lambda-compression demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.