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

@middy/cloudwatch-metrics

Package Overview
Dependencies
Maintainers
3
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@middy/cloudwatch-metrics - npm Package Compare versions

Comparing version 3.0.3 to 3.0.4

30

index.js

@@ -1,3 +0,31 @@

import awsEmbeddedMetrics from"aws-embedded-metrics";const defaults={};const cloudwatchMetricsMiddleware=(opts={})=>{const options={...defaults,...opts};const cloudwatchMetricsBefore=request=>{const metrics=awsEmbeddedMetrics.createMetricsLogger();if(options.namespace){metrics.setNamespace(options.namespace)}if(options.dimensions){metrics.setDimensions(...options.dimensions)}Object.assign(request.context,{metrics})};const cloudwatchMetricsAfter=async request=>{await request.context.metrics.flush()};return{before:cloudwatchMetricsBefore,after:cloudwatchMetricsAfter}};export default cloudwatchMetricsMiddleware
import awsEmbeddedMetrics from 'aws-embedded-metrics';
const defaults = {};
const cloudwatchMetricsMiddleware = (opts = {})=>{
const options = {
...defaults,
...opts
};
const cloudwatchMetricsBefore = (request)=>{
const metrics = awsEmbeddedMetrics.createMetricsLogger();
if (options.namespace) {
metrics.setNamespace(options.namespace);
}
if (options.dimensions) {
metrics.setDimensions(...options.dimensions);
}
Object.assign(request.context, {
metrics
});
};
const cloudwatchMetricsAfter = async (request)=>{
await request.context.metrics.flush();
};
return {
before: cloudwatchMetricsBefore,
after: cloudwatchMetricsAfter
};
};
export default cloudwatchMetricsMiddleware;
//# sourceMappingURL=index.js.map

8

package.json
{
"name": "@middy/cloudwatch-metrics",
"version": "3.0.3",
"version": "3.0.4",
"description": "Embedded CloudWatch metrics middleware for the middy framework",

@@ -61,8 +61,8 @@ "type": "module",

"dependencies": {
"aws-embedded-metrics": "2.0.4"
"aws-embedded-metrics": "2.0.5"
},
"devDependencies": {
"@middy/core": "3.0.3"
"@middy/core": "3.0.4"
},
"gitHead": "ea9e5e8cce754d0c467c7dd3ac9a7601149efea2"
"gitHead": "3e9bc83e791f943c71cd7003fc27f0a3692d83a1"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc