@middy/cloudwatch-metrics 2.5.6 → 3.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2021 Luciano Mammino, will Farrell and the [Middy team](https://github.com/middyjs/middy/graphs/contributors)
3
+ Copyright (c) 2017-2022 Luciano Mammino, will Farrell and the [Middy team](https://github.com/middyjs/middy/graphs/contributors)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -58,8 +58,8 @@ npm install --save @middy/cloudwatch-metrics
58
58
  ## Sample usage
59
59
 
60
60
  ```javascript
61
- const middy = require('@middy/core')
62
- const cloudwatchMetrics = require('@middy/cloudwatch-metrics')
61
+ import middy from '@middy/core'
62
+ import cloudwatchMetrics from '@middy/cloudwatch-metrics'
63
63
 
64
64
  const handler = middy((event, context) => {
65
65
  context.metrics.putMetric("ProcessingLatency", 100, "Milliseconds");
package/index.js CHANGED
@@ -1,7 +1,8 @@
1
- const awsEmbeddedMetrics = require('aws-embedded-metrics')
1
+ import awsEmbeddedMetrics from 'aws-embedded-metrics'
2
+
3
+ const defaults = {}
2
4
 
3
5
  const cloudwatchMetricsMiddleware = (opts = {}) => {
4
- const defaults = {}
5
6
  const options = { ...defaults, ...opts }
6
7
 
7
8
  const cloudwatchMetricsBefore = (request) => {
@@ -29,4 +30,4 @@ const cloudwatchMetricsMiddleware = (opts = {}) => {
29
30
  }
30
31
  }
31
32
 
32
- module.exports = cloudwatchMetricsMiddleware
33
+ export default cloudwatchMetricsMiddleware
package/package.json CHANGED
@@ -1,23 +1,25 @@
1
1
  {
2
2
  "name": "@middy/cloudwatch-metrics",
3
- "version": "2.5.6",
3
+ "version": "3.0.0-alpha.3",
4
4
  "description": "Embedded CloudWatch metrics middleware for the middy framework",
5
- "type": "commonjs",
5
+ "type": "module",
6
6
  "engines": {
7
- "node": ">=12"
7
+ "node": ">=14"
8
8
  },
9
9
  "engineStrict": true,
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
- "main": "index.js",
13
+ "exports": "./index.js",
14
14
  "types": "index.d.ts",
15
15
  "files": [
16
+ "index.js",
16
17
  "index.d.ts"
17
18
  ],
18
19
  "scripts": {
19
20
  "test": "npm run test:unit",
20
- "test:unit": "ava"
21
+ "test:unit": "ava",
22
+ "test:benchmark": "node __benchmarks__/index.js"
21
23
  },
22
24
  "license": "MIT",
23
25
  "keywords": [
@@ -52,7 +54,7 @@
52
54
  "aws-embedded-metrics": "2.0.4"
53
55
  },
54
56
  "devDependencies": {
55
- "@middy/core": "^2.5.6"
57
+ "@middy/core": "^3.0.0-alpha.3"
56
58
  },
57
- "gitHead": "0c789f55b4adf691f977b0d9904d1a805bb3bb2b"
59
+ "gitHead": "1441158711580313765e6d156046ef0fade0d156"
58
60
  }