@lambda-lambda-lambda/router
Advanced tools
| const {defineConfig} = require('eslint/config'); | ||
| module.exports = defineConfig([ | ||
| { | ||
| languageOptions: { | ||
| globals: { | ||
| es6: true, | ||
| node: true | ||
| }, | ||
| parserOptions: { | ||
| ecmaVersion: 2021, | ||
| sourceType: 'module' | ||
| } | ||
| }, | ||
| rules: { | ||
| 'array-bracket-spacing': [ | ||
| 2, | ||
| 'never' | ||
| ], | ||
| 'block-scoped-var': 2, | ||
| 'brace-style': [ | ||
| 2, | ||
| '1tbs' | ||
| ], | ||
| 'camelcase': 1, | ||
| 'computed-property-spacing': [ | ||
| 2, | ||
| 'never' | ||
| ], | ||
| 'curly': 2, | ||
| 'eol-last': 2, | ||
| 'eqeqeq': [ | ||
| 2, | ||
| 'smart' | ||
| ], | ||
| 'max-depth': [ | ||
| 1, | ||
| 3 | ||
| ], | ||
| 'new-cap': 0, | ||
| 'no-extend-native': 2, | ||
| 'no-mixed-spaces-and-tabs': 2, | ||
| 'no-trailing-spaces': 2, | ||
| 'no-unused-vars': 0, | ||
| 'no-use-before-define': [ | ||
| 2, | ||
| 'nofunc' | ||
| ], | ||
| 'object-curly-spacing': [ | ||
| 2, | ||
| 'never' | ||
| ], | ||
| 'quotes': [ | ||
| 2, | ||
| 'single', | ||
| 'avoid-escape' | ||
| ], | ||
| 'semi': [ | ||
| 2, | ||
| 'always' | ||
| ], | ||
| 'keyword-spacing': [ | ||
| 2, | ||
| { | ||
| 'before': true, | ||
| 'after': true | ||
| } | ||
| ], | ||
| 'space-unary-ops': 2 | ||
| } | ||
| } | ||
| ]); |
+6
-1
@@ -73,4 +73,9 @@ # Changelog | ||
| ## [0.8.6] - 2025-17-08 | ||
| ## [0.8.6] - 2025-08-17 | ||
| - Upgraded outdated NPM packages | ||
| ## [0.8.7] - 2025-09-21 | ||
| - Support `async` use in default() route | ||
| - Replaced ESLint deprecated release |
+1
-1
| MIT License | ||
| Copyright (c) 2021-2023 Marc S. Brooks (https://mbrooks.info) | ||
| Copyright (c) 2021-2025 Marc S. Brooks (https://mbrooks.info) | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
+2
-2
| { | ||
| "name": "@lambda-lambda-lambda/router", | ||
| "description": "AWS CloudFront Lambda@Edge serverless application router.", | ||
| "version": "0.8.6", | ||
| "version": "0.8.7", | ||
| "main": "src/Router.js", | ||
@@ -37,3 +37,3 @@ "scripts": { | ||
| "clone": "^2.1.2", | ||
| "eslint": "^8.57.1", | ||
| "eslint": "^9.36.0", | ||
| "jsdoc": "^4.0.4", | ||
@@ -40,0 +40,0 @@ "mocha": "^10.8.2", |
+11
-1
| # L³ router | ||
| [](https://badge.fury.io/js/@lambda-lambda-lambda%2Frouter) [](https://www.npmjs.com/package/@lambda-lambda-lambda/router) [](https://github.com/lambda-lambda-lambda/router/actions) [](https://coveralls.io/r/lambda-lambda-lambda/router?branch=master) [](https://packagephobia.com/result?p=@lambda-lambda-lambda/router) | ||
| [](https://badge.fury.io/js/@lambda-lambda-lambda%2Frouter) [](https://www.npmjs.com/package/@lambda-lambda-lambda/router) [](https://github.com/lambda-lambda-lambda/router/actions) [](https://coveralls.io/r/lambda-lambda-lambda/router?branch=master) [](https://packagephobia.com/result?p=@lambda-lambda-lambda/router) [](https://github.com/nuxy/no-ai-badge) | ||
@@ -62,2 +62,12 @@ AWS [CloudFront Lambda@Edge](https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html) serverless application router. | ||
| ## AWS changes starting in Node.js 24 (CloudWatch warning) | ||
| Going forward, it is recommended that you build your L³ application using `async` handlers in anticipation of the AWS changes below. | ||
| > AWS Lambda plans to remove support for callback-based function handlers starting with Node.js 24. You will need to update this function to use an async handler to use Node.js 24 or later. For more information and to provide feedback on this change, see aws/aws-lambda-nodejs-runtime-interface-client#137 | ||
| While backwards compatibity will be supported for older Node.js releases this support **will eventually be phased out** with the deprecation of `nodejs22.x` (Apr 30, 2027). | ||
| See [AWS Node.js Supported Runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported) for support information. | ||
| ## Versioning | ||
@@ -64,0 +74,0 @@ |
+1
-1
@@ -7,3 +7,3 @@ # Security Policy | ||
| | ------- | ------------------ | | ||
| | 0.7.x | :white_check_mark: | | ||
| | 0.7.x | :x: | | ||
| | 0.8.x | :white_check_mark: | | ||
@@ -10,0 +10,0 @@ |
+11
-4
@@ -5,3 +5,3 @@ /** | ||
| * | ||
| * Copyright 2021-2023, Marc S. Brooks (https://mbrooks.info) | ||
| * Copyright 2021-2025, Marc S. Brooks (https://mbrooks.info) | ||
| * Licensed under the MIT license: | ||
@@ -23,2 +23,3 @@ * http://www.opensource.org/licenses/mit-license.php | ||
| const { | ||
| isAsyncFunc, | ||
| isPromise, | ||
@@ -194,6 +195,12 @@ isValidFunc, | ||
| if (isValidFunc(route)) { | ||
| const func = (req, res, next) => { | ||
| route(req, res, next); | ||
| }; | ||
| let func = route; | ||
| if (isAsyncFunc(route) === false) { | ||
| // Construct synchronous function. | ||
| func = (req, res, next) => { | ||
| route(req, res, next); | ||
| }; | ||
| } | ||
| setFuncName(func, 'fallback'); | ||
@@ -200,0 +207,0 @@ |
@@ -5,3 +5,3 @@ /** | ||
| * | ||
| * Copyright 2021-2023, Marc S. Brooks (https://mbrooks.info) | ||
| * Copyright 2021-2025, Marc S. Brooks (https://mbrooks.info) | ||
| * Licensed under the MIT license: | ||
@@ -8,0 +8,0 @@ * http://www.opensource.org/licenses/mit-license.php |
@@ -5,3 +5,3 @@ /** | ||
| * | ||
| * Copyright 2021-2023, Marc S. Brooks (https://mbrooks.info) | ||
| * Copyright 2021-2025, Marc S. Brooks (https://mbrooks.info) | ||
| * Licensed under the MIT license: | ||
@@ -8,0 +8,0 @@ * http://www.opensource.org/licenses/mit-license.php |
@@ -5,3 +5,3 @@ /** | ||
| * | ||
| * Copyright 2021-2023, Marc S. Brooks (https://mbrooks.info) | ||
| * Copyright 2021-2025, Marc S. Brooks (https://mbrooks.info) | ||
| * Licensed under the MIT license: | ||
@@ -8,0 +8,0 @@ * http://www.opensource.org/licenses/mit-license.php |
@@ -7,3 +7,3 @@ /** @module router/Route */ | ||
| * | ||
| * Copyright 2021-2023, Marc S. Brooks (https://mbrooks.info) | ||
| * Copyright 2021-2025, Marc S. Brooks (https://mbrooks.info) | ||
| * Licensed under the MIT license: | ||
@@ -10,0 +10,0 @@ * http://www.opensource.org/licenses/mit-license.php |
@@ -5,3 +5,3 @@ /** | ||
| * | ||
| * Copyright 2021-2023, Marc S. Brooks (https://mbrooks.info) | ||
| * Copyright 2021-2025, Marc S. Brooks (https://mbrooks.info) | ||
| * Licensed under the MIT license: | ||
@@ -8,0 +8,0 @@ * http://www.opensource.org/licenses/mit-license.php |
@@ -7,3 +7,3 @@ /** @module router/Utils */ | ||
| * | ||
| * Copyright 2021-2023, Marc S. Brooks (https://mbrooks.info) | ||
| * Copyright 2021-2025, Marc S. Brooks (https://mbrooks.info) | ||
| * Licensed under the MIT license: | ||
@@ -10,0 +10,0 @@ * http://www.opensource.org/licenses/mit-license.php |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
39240
6.59%14
7.69%1222
6.63%87
12.99%