expressed-core 1.0.0
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/README-es.md +42 -0
- package/README-es.md.backup +44 -0
- package/README.md +41 -0
- package/README.md.backup +43 -0
- package/hooked/LICENSE +204 -0
- package/hooked/README.es.md +238 -0
- package/hooked/README.md +238 -0
- package/hooked/advanced-example.js +240 -0
- package/hooked/express-hooked.js +206 -0
- package/hooked/hooks.js +584 -0
- package/hooked/package.json +30 -0
- package/index.js +25 -0
- package/package.json +36 -0
- package/queued/LICENSE +201 -0
- package/queued/QueueSystem.js +451 -0
- package/queued/README.es.md +335 -0
- package/queued/README.md +335 -0
- package/queued/express-example.js +143 -0
- package/queued/express-integration.js +115 -0
- package/queued/package.json +33 -0
- package/router/ExpressRouter.js +247 -0
- package/router/ExpressRouterIntegration.js +129 -0
- package/router/LICENSE +201 -0
- package/router/README.es.md +142 -0
- package/router/README.md +142 -0
- package/router/RouteDirectoryLoader.js +299 -0
- package/router/RouteLoader.js +245 -0
- package/router/RouteMatcher.js +361 -0
- package/router/node_modules/.package-lock.json +876 -0
- package/router/node_modules/accepts/HISTORY.md +243 -0
- package/router/node_modules/accepts/LICENSE +23 -0
- package/router/node_modules/accepts/README.md +140 -0
- package/router/node_modules/accepts/index.js +238 -0
- package/router/node_modules/accepts/package.json +47 -0
- package/router/node_modules/array-flatten/LICENSE +21 -0
- package/router/node_modules/array-flatten/README.md +43 -0
- package/router/node_modules/array-flatten/array-flatten.js +64 -0
- package/router/node_modules/array-flatten/package.json +39 -0
- package/router/node_modules/body-parser/HISTORY.md +680 -0
- package/router/node_modules/body-parser/LICENSE +23 -0
- package/router/node_modules/body-parser/README.md +476 -0
- package/router/node_modules/body-parser/index.js +156 -0
- package/router/node_modules/body-parser/lib/read.js +205 -0
- package/router/node_modules/body-parser/lib/types/json.js +247 -0
- package/router/node_modules/body-parser/lib/types/raw.js +101 -0
- package/router/node_modules/body-parser/lib/types/text.js +121 -0
- package/router/node_modules/body-parser/lib/types/urlencoded.js +300 -0
- package/router/node_modules/body-parser/package.json +55 -0
- package/router/node_modules/bytes/History.md +97 -0
- package/router/node_modules/bytes/LICENSE +23 -0
- package/router/node_modules/bytes/Readme.md +152 -0
- package/router/node_modules/bytes/index.js +170 -0
- package/router/node_modules/bytes/package.json +42 -0
- package/router/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/router/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/router/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/router/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/router/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/router/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/router/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/router/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/router/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/router/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/router/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/router/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/router/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/router/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/router/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/router/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/router/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/router/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/router/node_modules/call-bound/.github/FUNDING.yml +12 -0
- package/router/node_modules/call-bound/CHANGELOG.md +42 -0
- package/router/node_modules/call-bound/LICENSE +21 -0
- package/router/node_modules/call-bound/README.md +53 -0
- package/router/node_modules/call-bound/index.d.ts +94 -0
- package/router/node_modules/call-bound/index.js +19 -0
- package/router/node_modules/call-bound/package.json +99 -0
- package/router/node_modules/call-bound/tsconfig.json +10 -0
- package/router/node_modules/content-disposition/HISTORY.md +60 -0
- package/router/node_modules/content-disposition/LICENSE +22 -0
- package/router/node_modules/content-disposition/README.md +142 -0
- package/router/node_modules/content-disposition/index.js +458 -0
- package/router/node_modules/content-disposition/package.json +44 -0
- package/router/node_modules/content-type/HISTORY.md +29 -0
- package/router/node_modules/content-type/LICENSE +22 -0
- package/router/node_modules/content-type/README.md +94 -0
- package/router/node_modules/content-type/index.js +225 -0
- package/router/node_modules/content-type/package.json +42 -0
- package/router/node_modules/cookie/LICENSE +24 -0
- package/router/node_modules/cookie/README.md +317 -0
- package/router/node_modules/cookie/SECURITY.md +25 -0
- package/router/node_modules/cookie/index.js +335 -0
- package/router/node_modules/cookie/package.json +44 -0
- package/router/node_modules/cookie-signature/History.md +42 -0
- package/router/node_modules/cookie-signature/Readme.md +42 -0
- package/router/node_modules/cookie-signature/index.js +51 -0
- package/router/node_modules/cookie-signature/package.json +18 -0
- package/router/node_modules/debug/.coveralls.yml +1 -0
- package/router/node_modules/debug/CHANGELOG.md +362 -0
- package/router/node_modules/debug/LICENSE +19 -0
- package/router/node_modules/debug/Makefile +50 -0
- package/router/node_modules/debug/README.md +312 -0
- package/router/node_modules/debug/component.json +19 -0
- package/router/node_modules/debug/karma.conf.js +70 -0
- package/router/node_modules/debug/node.js +1 -0
- package/router/node_modules/debug/package.json +49 -0
- package/router/node_modules/debug/src/browser.js +185 -0
- package/router/node_modules/debug/src/debug.js +202 -0
- package/router/node_modules/debug/src/index.js +10 -0
- package/router/node_modules/debug/src/inspector-log.js +15 -0
- package/router/node_modules/debug/src/node.js +248 -0
- package/router/node_modules/depd/History.md +103 -0
- package/router/node_modules/depd/LICENSE +22 -0
- package/router/node_modules/depd/Readme.md +280 -0
- package/router/node_modules/depd/index.js +538 -0
- package/router/node_modules/depd/lib/browser/index.js +77 -0
- package/router/node_modules/depd/package.json +45 -0
- package/router/node_modules/destroy/LICENSE +23 -0
- package/router/node_modules/destroy/README.md +63 -0
- package/router/node_modules/destroy/index.js +209 -0
- package/router/node_modules/destroy/package.json +48 -0
- package/router/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/router/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/router/node_modules/dunder-proto/LICENSE +21 -0
- package/router/node_modules/dunder-proto/README.md +54 -0
- package/router/node_modules/dunder-proto/get.d.ts +5 -0
- package/router/node_modules/dunder-proto/get.js +30 -0
- package/router/node_modules/dunder-proto/package.json +76 -0
- package/router/node_modules/dunder-proto/set.d.ts +5 -0
- package/router/node_modules/dunder-proto/set.js +35 -0
- package/router/node_modules/dunder-proto/tsconfig.json +9 -0
- package/router/node_modules/ee-first/LICENSE +22 -0
- package/router/node_modules/ee-first/README.md +80 -0
- package/router/node_modules/ee-first/index.js +95 -0
- package/router/node_modules/ee-first/package.json +29 -0
- package/router/node_modules/encodeurl/LICENSE +22 -0
- package/router/node_modules/encodeurl/README.md +109 -0
- package/router/node_modules/encodeurl/index.js +60 -0
- package/router/node_modules/encodeurl/package.json +40 -0
- package/router/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/router/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/router/node_modules/es-define-property/LICENSE +21 -0
- package/router/node_modules/es-define-property/README.md +49 -0
- package/router/node_modules/es-define-property/index.d.ts +3 -0
- package/router/node_modules/es-define-property/index.js +14 -0
- package/router/node_modules/es-define-property/package.json +81 -0
- package/router/node_modules/es-define-property/tsconfig.json +10 -0
- package/router/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/router/node_modules/es-errors/CHANGELOG.md +40 -0
- package/router/node_modules/es-errors/LICENSE +21 -0
- package/router/node_modules/es-errors/README.md +55 -0
- package/router/node_modules/es-errors/eval.d.ts +3 -0
- package/router/node_modules/es-errors/eval.js +4 -0
- package/router/node_modules/es-errors/index.d.ts +3 -0
- package/router/node_modules/es-errors/index.js +4 -0
- package/router/node_modules/es-errors/package.json +80 -0
- package/router/node_modules/es-errors/range.d.ts +3 -0
- package/router/node_modules/es-errors/range.js +4 -0
- package/router/node_modules/es-errors/ref.d.ts +3 -0
- package/router/node_modules/es-errors/ref.js +4 -0
- package/router/node_modules/es-errors/syntax.d.ts +3 -0
- package/router/node_modules/es-errors/syntax.js +4 -0
- package/router/node_modules/es-errors/tsconfig.json +49 -0
- package/router/node_modules/es-errors/type.d.ts +3 -0
- package/router/node_modules/es-errors/type.js +4 -0
- package/router/node_modules/es-errors/uri.d.ts +3 -0
- package/router/node_modules/es-errors/uri.js +4 -0
- package/router/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/router/node_modules/es-object-atoms/CHANGELOG.md +37 -0
- package/router/node_modules/es-object-atoms/LICENSE +21 -0
- package/router/node_modules/es-object-atoms/README.md +63 -0
- package/router/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/router/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/router/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/router/node_modules/es-object-atoms/ToObject.js +10 -0
- package/router/node_modules/es-object-atoms/index.d.ts +3 -0
- package/router/node_modules/es-object-atoms/index.js +4 -0
- package/router/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/router/node_modules/es-object-atoms/isObject.js +6 -0
- package/router/node_modules/es-object-atoms/package.json +80 -0
- package/router/node_modules/es-object-atoms/tsconfig.json +6 -0
- package/router/node_modules/escape-html/LICENSE +24 -0
- package/router/node_modules/escape-html/Readme.md +43 -0
- package/router/node_modules/escape-html/index.js +78 -0
- package/router/node_modules/escape-html/package.json +24 -0
- package/router/node_modules/etag/HISTORY.md +83 -0
- package/router/node_modules/etag/LICENSE +22 -0
- package/router/node_modules/etag/README.md +159 -0
- package/router/node_modules/etag/index.js +131 -0
- package/router/node_modules/etag/package.json +47 -0
- package/router/node_modules/express/History.md +3667 -0
- package/router/node_modules/express/LICENSE +24 -0
- package/router/node_modules/express/Readme.md +260 -0
- package/router/node_modules/express/index.js +11 -0
- package/router/node_modules/express/lib/application.js +661 -0
- package/router/node_modules/express/lib/express.js +116 -0
- package/router/node_modules/express/lib/middleware/init.js +43 -0
- package/router/node_modules/express/lib/middleware/query.js +47 -0
- package/router/node_modules/express/lib/request.js +525 -0
- package/router/node_modules/express/lib/response.js +1179 -0
- package/router/node_modules/express/lib/router/index.js +673 -0
- package/router/node_modules/express/lib/router/layer.js +181 -0
- package/router/node_modules/express/lib/router/route.js +230 -0
- package/router/node_modules/express/lib/utils.js +303 -0
- package/router/node_modules/express/lib/view.js +182 -0
- package/router/node_modules/express/package.json +102 -0
- package/router/node_modules/express-hooked/LICENSE +204 -0
- package/router/node_modules/express-hooked/README.es.md +123 -0
- package/router/node_modules/express-hooked/README.md +123 -0
- package/router/node_modules/express-hooked/express-hooked.js +206 -0
- package/router/node_modules/express-hooked/hooks.js +584 -0
- package/router/node_modules/express-hooked/package.json +30 -0
- package/router/node_modules/finalhandler/HISTORY.md +216 -0
- package/router/node_modules/finalhandler/LICENSE +22 -0
- package/router/node_modules/finalhandler/README.md +147 -0
- package/router/node_modules/finalhandler/SECURITY.md +25 -0
- package/router/node_modules/finalhandler/index.js +341 -0
- package/router/node_modules/finalhandler/package.json +47 -0
- package/router/node_modules/forwarded/HISTORY.md +21 -0
- package/router/node_modules/forwarded/LICENSE +22 -0
- package/router/node_modules/forwarded/README.md +57 -0
- package/router/node_modules/forwarded/index.js +90 -0
- package/router/node_modules/forwarded/package.json +45 -0
- package/router/node_modules/fresh/HISTORY.md +70 -0
- package/router/node_modules/fresh/LICENSE +23 -0
- package/router/node_modules/fresh/README.md +119 -0
- package/router/node_modules/fresh/index.js +137 -0
- package/router/node_modules/fresh/package.json +46 -0
- package/router/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/router/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/router/node_modules/function-bind/CHANGELOG.md +136 -0
- package/router/node_modules/function-bind/LICENSE +20 -0
- package/router/node_modules/function-bind/README.md +46 -0
- package/router/node_modules/function-bind/implementation.js +84 -0
- package/router/node_modules/function-bind/index.js +5 -0
- package/router/node_modules/function-bind/package.json +87 -0
- package/router/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/router/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/router/node_modules/get-intrinsic/LICENSE +21 -0
- package/router/node_modules/get-intrinsic/README.md +71 -0
- package/router/node_modules/get-intrinsic/index.js +378 -0
- package/router/node_modules/get-intrinsic/package.json +97 -0
- package/router/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/router/node_modules/get-proto/CHANGELOG.md +21 -0
- package/router/node_modules/get-proto/LICENSE +21 -0
- package/router/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/router/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/router/node_modules/get-proto/README.md +50 -0
- package/router/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/router/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/router/node_modules/get-proto/index.d.ts +5 -0
- package/router/node_modules/get-proto/index.js +27 -0
- package/router/node_modules/get-proto/package.json +81 -0
- package/router/node_modules/get-proto/tsconfig.json +9 -0
- package/router/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/router/node_modules/gopd/CHANGELOG.md +45 -0
- package/router/node_modules/gopd/LICENSE +21 -0
- package/router/node_modules/gopd/README.md +40 -0
- package/router/node_modules/gopd/gOPD.d.ts +1 -0
- package/router/node_modules/gopd/gOPD.js +4 -0
- package/router/node_modules/gopd/index.d.ts +5 -0
- package/router/node_modules/gopd/index.js +15 -0
- package/router/node_modules/gopd/package.json +77 -0
- package/router/node_modules/gopd/tsconfig.json +9 -0
- package/router/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/router/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/router/node_modules/has-symbols/LICENSE +21 -0
- package/router/node_modules/has-symbols/README.md +46 -0
- package/router/node_modules/has-symbols/index.d.ts +3 -0
- package/router/node_modules/has-symbols/index.js +14 -0
- package/router/node_modules/has-symbols/package.json +111 -0
- package/router/node_modules/has-symbols/shams.d.ts +3 -0
- package/router/node_modules/has-symbols/shams.js +45 -0
- package/router/node_modules/has-symbols/tsconfig.json +10 -0
- package/router/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/router/node_modules/hasown/CHANGELOG.md +40 -0
- package/router/node_modules/hasown/LICENSE +21 -0
- package/router/node_modules/hasown/README.md +40 -0
- package/router/node_modules/hasown/index.d.ts +3 -0
- package/router/node_modules/hasown/index.js +8 -0
- package/router/node_modules/hasown/package.json +92 -0
- package/router/node_modules/hasown/tsconfig.json +6 -0
- package/router/node_modules/http-errors/HISTORY.md +186 -0
- package/router/node_modules/http-errors/LICENSE +23 -0
- package/router/node_modules/http-errors/README.md +169 -0
- package/router/node_modules/http-errors/index.js +290 -0
- package/router/node_modules/http-errors/package.json +54 -0
- package/router/node_modules/iconv-lite/Changelog.md +162 -0
- package/router/node_modules/iconv-lite/LICENSE +21 -0
- package/router/node_modules/iconv-lite/README.md +156 -0
- package/router/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
- package/router/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
- package/router/node_modules/iconv-lite/encodings/index.js +22 -0
- package/router/node_modules/iconv-lite/encodings/internal.js +188 -0
- package/router/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/router/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/router/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
- package/router/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/router/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/router/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/router/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/router/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/router/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/router/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
- package/router/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/router/node_modules/iconv-lite/encodings/utf16.js +177 -0
- package/router/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/router/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/router/node_modules/iconv-lite/lib/extend-node.js +217 -0
- package/router/node_modules/iconv-lite/lib/index.d.ts +24 -0
- package/router/node_modules/iconv-lite/lib/index.js +153 -0
- package/router/node_modules/iconv-lite/lib/streams.js +121 -0
- package/router/node_modules/iconv-lite/package.json +46 -0
- package/router/node_modules/inherits/LICENSE +16 -0
- package/router/node_modules/inherits/README.md +42 -0
- package/router/node_modules/inherits/inherits.js +9 -0
- package/router/node_modules/inherits/inherits_browser.js +27 -0
- package/router/node_modules/inherits/package.json +29 -0
- package/router/node_modules/ipaddr.js/LICENSE +19 -0
- package/router/node_modules/ipaddr.js/README.md +233 -0
- package/router/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- package/router/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
- package/router/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
- package/router/node_modules/ipaddr.js/package.json +35 -0
- package/router/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/router/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/router/node_modules/math-intrinsics/LICENSE +21 -0
- package/router/node_modules/math-intrinsics/README.md +50 -0
- package/router/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/router/node_modules/math-intrinsics/abs.js +4 -0
- package/router/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/router/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/router/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/router/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/router/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/router/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/router/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/router/node_modules/math-intrinsics/floor.js +4 -0
- package/router/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/router/node_modules/math-intrinsics/isFinite.js +12 -0
- package/router/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/router/node_modules/math-intrinsics/isInteger.js +16 -0
- package/router/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/router/node_modules/math-intrinsics/isNaN.js +6 -0
- package/router/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/router/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/router/node_modules/math-intrinsics/max.d.ts +1 -0
- package/router/node_modules/math-intrinsics/max.js +4 -0
- package/router/node_modules/math-intrinsics/min.d.ts +1 -0
- package/router/node_modules/math-intrinsics/min.js +4 -0
- package/router/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/router/node_modules/math-intrinsics/mod.js +9 -0
- package/router/node_modules/math-intrinsics/package.json +86 -0
- package/router/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/router/node_modules/math-intrinsics/pow.js +4 -0
- package/router/node_modules/math-intrinsics/round.d.ts +1 -0
- package/router/node_modules/math-intrinsics/round.js +4 -0
- package/router/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/router/node_modules/math-intrinsics/sign.js +11 -0
- package/router/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/router/node_modules/media-typer/HISTORY.md +22 -0
- package/router/node_modules/media-typer/LICENSE +22 -0
- package/router/node_modules/media-typer/README.md +81 -0
- package/router/node_modules/media-typer/index.js +270 -0
- package/router/node_modules/media-typer/package.json +26 -0
- package/router/node_modules/merge-descriptors/HISTORY.md +21 -0
- package/router/node_modules/merge-descriptors/LICENSE +23 -0
- package/router/node_modules/merge-descriptors/README.md +49 -0
- package/router/node_modules/merge-descriptors/index.js +60 -0
- package/router/node_modules/merge-descriptors/package.json +39 -0
- package/router/node_modules/methods/HISTORY.md +29 -0
- package/router/node_modules/methods/LICENSE +24 -0
- package/router/node_modules/methods/README.md +51 -0
- package/router/node_modules/methods/index.js +69 -0
- package/router/node_modules/methods/package.json +36 -0
- package/router/node_modules/mime/CHANGELOG.md +164 -0
- package/router/node_modules/mime/LICENSE +21 -0
- package/router/node_modules/mime/README.md +90 -0
- package/router/node_modules/mime/cli.js +8 -0
- package/router/node_modules/mime/mime.js +108 -0
- package/router/node_modules/mime/package.json +44 -0
- package/router/node_modules/mime/src/build.js +53 -0
- package/router/node_modules/mime/src/test.js +60 -0
- package/router/node_modules/mime/types.json +1 -0
- package/router/node_modules/mime-db/HISTORY.md +507 -0
- package/router/node_modules/mime-db/LICENSE +23 -0
- package/router/node_modules/mime-db/README.md +100 -0
- package/router/node_modules/mime-db/db.json +8519 -0
- package/router/node_modules/mime-db/index.js +12 -0
- package/router/node_modules/mime-db/package.json +60 -0
- package/router/node_modules/mime-types/HISTORY.md +397 -0
- package/router/node_modules/mime-types/LICENSE +23 -0
- package/router/node_modules/mime-types/README.md +113 -0
- package/router/node_modules/mime-types/index.js +188 -0
- package/router/node_modules/mime-types/package.json +44 -0
- package/router/node_modules/ms/index.js +152 -0
- package/router/node_modules/ms/license.md +21 -0
- package/router/node_modules/ms/package.json +37 -0
- package/router/node_modules/ms/readme.md +51 -0
- package/router/node_modules/negotiator/HISTORY.md +108 -0
- package/router/node_modules/negotiator/LICENSE +24 -0
- package/router/node_modules/negotiator/README.md +203 -0
- package/router/node_modules/negotiator/index.js +82 -0
- package/router/node_modules/negotiator/lib/charset.js +169 -0
- package/router/node_modules/negotiator/lib/encoding.js +184 -0
- package/router/node_modules/negotiator/lib/language.js +179 -0
- package/router/node_modules/negotiator/lib/mediaType.js +294 -0
- package/router/node_modules/negotiator/package.json +42 -0
- package/router/node_modules/object-inspect/.github/FUNDING.yml +12 -0
- package/router/node_modules/object-inspect/CHANGELOG.md +424 -0
- package/router/node_modules/object-inspect/LICENSE +21 -0
- package/router/node_modules/object-inspect/example/all.js +23 -0
- package/router/node_modules/object-inspect/example/circular.js +6 -0
- package/router/node_modules/object-inspect/example/fn.js +5 -0
- package/router/node_modules/object-inspect/example/inspect.js +10 -0
- package/router/node_modules/object-inspect/index.js +544 -0
- package/router/node_modules/object-inspect/package-support.json +20 -0
- package/router/node_modules/object-inspect/package.json +105 -0
- package/router/node_modules/object-inspect/readme.markdown +84 -0
- package/router/node_modules/object-inspect/test-core-js.js +26 -0
- package/router/node_modules/object-inspect/util.inspect.js +1 -0
- package/router/node_modules/on-finished/HISTORY.md +98 -0
- package/router/node_modules/on-finished/LICENSE +23 -0
- package/router/node_modules/on-finished/README.md +162 -0
- package/router/node_modules/on-finished/index.js +234 -0
- package/router/node_modules/on-finished/package.json +39 -0
- package/router/node_modules/parseurl/HISTORY.md +58 -0
- package/router/node_modules/parseurl/LICENSE +24 -0
- package/router/node_modules/parseurl/README.md +133 -0
- package/router/node_modules/parseurl/index.js +158 -0
- package/router/node_modules/parseurl/package.json +40 -0
- package/router/node_modules/path-to-regexp/LICENSE +21 -0
- package/router/node_modules/path-to-regexp/Readme.md +35 -0
- package/router/node_modules/path-to-regexp/index.js +156 -0
- package/router/node_modules/path-to-regexp/package.json +30 -0
- package/router/node_modules/proxy-addr/HISTORY.md +161 -0
- package/router/node_modules/proxy-addr/LICENSE +22 -0
- package/router/node_modules/proxy-addr/README.md +139 -0
- package/router/node_modules/proxy-addr/index.js +327 -0
- package/router/node_modules/proxy-addr/package.json +47 -0
- package/router/node_modules/qs/.github/FUNDING.yml +12 -0
- package/router/node_modules/qs/.github/SECURITY.md +11 -0
- package/router/node_modules/qs/.github/THREAT_MODEL.md +78 -0
- package/router/node_modules/qs/CHANGELOG.md +644 -0
- package/router/node_modules/qs/LICENSE.md +29 -0
- package/router/node_modules/qs/README.md +740 -0
- package/router/node_modules/qs/dist/qs.js +141 -0
- package/router/node_modules/qs/eslint.config.mjs +56 -0
- package/router/node_modules/qs/lib/formats.js +23 -0
- package/router/node_modules/qs/lib/index.js +11 -0
- package/router/node_modules/qs/lib/parse.js +371 -0
- package/router/node_modules/qs/lib/stringify.js +356 -0
- package/router/node_modules/qs/lib/utils.js +340 -0
- package/router/node_modules/qs/package.json +94 -0
- package/router/node_modules/range-parser/HISTORY.md +56 -0
- package/router/node_modules/range-parser/LICENSE +23 -0
- package/router/node_modules/range-parser/README.md +84 -0
- package/router/node_modules/range-parser/index.js +162 -0
- package/router/node_modules/range-parser/package.json +44 -0
- package/router/node_modules/raw-body/LICENSE +22 -0
- package/router/node_modules/raw-body/README.md +223 -0
- package/router/node_modules/raw-body/index.d.ts +87 -0
- package/router/node_modules/raw-body/index.js +336 -0
- package/router/node_modules/raw-body/package.json +47 -0
- package/router/node_modules/safe-buffer/LICENSE +21 -0
- package/router/node_modules/safe-buffer/README.md +584 -0
- package/router/node_modules/safe-buffer/index.d.ts +187 -0
- package/router/node_modules/safe-buffer/index.js +65 -0
- package/router/node_modules/safe-buffer/package.json +51 -0
- package/router/node_modules/safer-buffer/LICENSE +21 -0
- package/router/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/router/node_modules/safer-buffer/Readme.md +156 -0
- package/router/node_modules/safer-buffer/dangerous.js +58 -0
- package/router/node_modules/safer-buffer/package.json +34 -0
- package/router/node_modules/safer-buffer/safer.js +77 -0
- package/router/node_modules/safer-buffer/tests.js +406 -0
- package/router/node_modules/send/HISTORY.md +538 -0
- package/router/node_modules/send/LICENSE +23 -0
- package/router/node_modules/send/README.md +327 -0
- package/router/node_modules/send/SECURITY.md +24 -0
- package/router/node_modules/send/index.js +1142 -0
- package/router/node_modules/send/node_modules/ms/index.js +162 -0
- package/router/node_modules/send/node_modules/ms/license.md +21 -0
- package/router/node_modules/send/node_modules/ms/package.json +38 -0
- package/router/node_modules/send/node_modules/ms/readme.md +59 -0
- package/router/node_modules/send/package.json +62 -0
- package/router/node_modules/serve-static/HISTORY.md +493 -0
- package/router/node_modules/serve-static/LICENSE +25 -0
- package/router/node_modules/serve-static/README.md +257 -0
- package/router/node_modules/serve-static/index.js +209 -0
- package/router/node_modules/serve-static/package.json +42 -0
- package/router/node_modules/setprototypeof/LICENSE +13 -0
- package/router/node_modules/setprototypeof/README.md +31 -0
- package/router/node_modules/setprototypeof/index.d.ts +2 -0
- package/router/node_modules/setprototypeof/index.js +17 -0
- package/router/node_modules/setprototypeof/package.json +38 -0
- package/router/node_modules/side-channel/.github/FUNDING.yml +12 -0
- package/router/node_modules/side-channel/CHANGELOG.md +110 -0
- package/router/node_modules/side-channel/LICENSE +21 -0
- package/router/node_modules/side-channel/README.md +61 -0
- package/router/node_modules/side-channel/index.d.ts +14 -0
- package/router/node_modules/side-channel/index.js +43 -0
- package/router/node_modules/side-channel/package.json +85 -0
- package/router/node_modules/side-channel/tsconfig.json +9 -0
- package/router/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
- package/router/node_modules/side-channel-list/CHANGELOG.md +15 -0
- package/router/node_modules/side-channel-list/LICENSE +21 -0
- package/router/node_modules/side-channel-list/README.md +62 -0
- package/router/node_modules/side-channel-list/index.d.ts +13 -0
- package/router/node_modules/side-channel-list/index.js +113 -0
- package/router/node_modules/side-channel-list/list.d.ts +14 -0
- package/router/node_modules/side-channel-list/package.json +77 -0
- package/router/node_modules/side-channel-list/tsconfig.json +9 -0
- package/router/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
- package/router/node_modules/side-channel-map/CHANGELOG.md +22 -0
- package/router/node_modules/side-channel-map/LICENSE +21 -0
- package/router/node_modules/side-channel-map/README.md +62 -0
- package/router/node_modules/side-channel-map/index.d.ts +15 -0
- package/router/node_modules/side-channel-map/index.js +68 -0
- package/router/node_modules/side-channel-map/package.json +80 -0
- package/router/node_modules/side-channel-map/tsconfig.json +9 -0
- package/router/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
- package/router/node_modules/side-channel-weakmap/CHANGELOG.md +28 -0
- package/router/node_modules/side-channel-weakmap/LICENSE +21 -0
- package/router/node_modules/side-channel-weakmap/README.md +62 -0
- package/router/node_modules/side-channel-weakmap/index.d.ts +15 -0
- package/router/node_modules/side-channel-weakmap/index.js +84 -0
- package/router/node_modules/side-channel-weakmap/package.json +87 -0
- package/router/node_modules/side-channel-weakmap/tsconfig.json +9 -0
- package/router/node_modules/statuses/HISTORY.md +87 -0
- package/router/node_modules/statuses/LICENSE +23 -0
- package/router/node_modules/statuses/README.md +139 -0
- package/router/node_modules/statuses/codes.json +65 -0
- package/router/node_modules/statuses/index.js +146 -0
- package/router/node_modules/statuses/package.json +49 -0
- package/router/node_modules/toidentifier/HISTORY.md +9 -0
- package/router/node_modules/toidentifier/LICENSE +21 -0
- package/router/node_modules/toidentifier/README.md +61 -0
- package/router/node_modules/toidentifier/index.js +32 -0
- package/router/node_modules/toidentifier/package.json +38 -0
- package/router/node_modules/type-is/HISTORY.md +259 -0
- package/router/node_modules/type-is/LICENSE +23 -0
- package/router/node_modules/type-is/README.md +170 -0
- package/router/node_modules/type-is/index.js +266 -0
- package/router/node_modules/type-is/package.json +45 -0
- package/router/node_modules/unpipe/HISTORY.md +4 -0
- package/router/node_modules/unpipe/LICENSE +22 -0
- package/router/node_modules/unpipe/README.md +43 -0
- package/router/node_modules/unpipe/index.js +69 -0
- package/router/node_modules/unpipe/package.json +27 -0
- package/router/node_modules/utils-merge/LICENSE +20 -0
- package/router/node_modules/utils-merge/README.md +34 -0
- package/router/node_modules/utils-merge/index.js +23 -0
- package/router/node_modules/utils-merge/package.json +40 -0
- package/router/node_modules/vary/HISTORY.md +39 -0
- package/router/node_modules/vary/LICENSE +22 -0
- package/router/node_modules/vary/README.md +101 -0
- package/router/node_modules/vary/index.js +149 -0
- package/router/node_modules/vary/package.json +43 -0
- package/router/package.json +36 -0
package/README-es.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# EXPRESSED: El Manifiesto de la Persistencia Inyectable
|
|
2
|
+
|
|
3
|
+
### (O por qué tu falta de visión no es una carencia de mi código)
|
|
4
|
+
|
|
5
|
+
En la ingeniería de software profesional, existe una distinción fundamental entre un **sistema de ejecución** y una **capa de datos**. El ecosistema **EXPRESSED** (Router, Hooked, Queued) ha sido diseñado para ser un motor de alto rendimiento, no una base de datos disfrazada de plugin.
|
|
6
|
+
|
|
7
|
+
## 1. El Error Conceptual de la "Persistencia Forzada"
|
|
8
|
+
|
|
9
|
+
Insistir en que a un sistema de colas o de hooks "le falta persistencia" es no entender el principio de **Responsabilidad Única**. Obligar a que `Express-Queued` dependa de Redis o MariaDB sería secuestrar el stack tecnológico del usuario.
|
|
10
|
+
|
|
11
|
+
* **Soberanía Técnica**: EXPRESSED asume que el arquitecto sabe qué base de datos es mejor para su proyecto.
|
|
12
|
+
* **Eficiencia de Cómputo**: Las tareas volátiles (logs, analítica, notificaciones temporales) no deben sufrir la latencia de red de una base de datos externa.
|
|
13
|
+
* **Cero Dependencias**: El core permanece ligero, sin "basura" de drivers o configuraciones que el 50% de los proyectos no usará.
|
|
14
|
+
|
|
15
|
+
## 2. La Ingeniería de la "Persistencia como Plugin"
|
|
16
|
+
|
|
17
|
+
Para quienes saben leer código, la persistencia en EXPRESSED ya existe: es **inyectable**. Gracias a la integración nativa entre los componentes, la durabilidad de los datos es una elección, no una imposición.
|
|
18
|
+
|
|
19
|
+
* **Hooks de Ciclo de Vida**: `Express-Queued` emite eventos como `queue_task_added` y `queue_task_completed` a través de `Express-Hooked`.
|
|
20
|
+
* **Implementación Quirúrgica**: Puedes decidir persistir solo las colas de "Pagos" en MariaDB, mientras las de "Emails" corren exclusivamente en memoria para máxima velocidad.
|
|
21
|
+
* **Agnosticismo Total**: Si mañana cambias de Redis a PostgreSQL, no tienes que cambiar el sistema de colas; solo cambias el hook de persistencia.
|
|
22
|
+
|
|
23
|
+
## 3. Comparativa de Rendimiento: Memoria vs. Disco
|
|
24
|
+
|
|
25
|
+
Los que piden persistencia por defecto a menudo ignoran el costo en milisegundos.
|
|
26
|
+
|
|
27
|
+
| Operación | EXPRESSED (In-Memory) | Sistemas Basados en Redis/DB |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| **Latencia de encolado** | **< 0.01ms** (Acceso a Heap V8) | 1ms - 5ms (Network Round-trip) |
|
|
30
|
+
| **Sobrecarga de CPU** | Mínima (Punteros de objeto) | Alta (Serialización/Deserialización JSON) |
|
|
31
|
+
| **Escalabilidad** | Limitada por RAM (Vertical) | Limitada por Red/I/O (Horizontal) |
|
|
32
|
+
|
|
33
|
+
## 4. Conclusión para Arquitectos (No para "Copiapastes")
|
|
34
|
+
|
|
35
|
+
**EXPRESSED** institucionaliza Express.js dándole una estructura profesional:
|
|
36
|
+
|
|
37
|
+
1. **Router**: Optimiza el tráfico mediante índices y caché de RegEx.
|
|
38
|
+
2. **Hooked**: Proporciona el sistema nervioso para extender la app sin romperla.
|
|
39
|
+
3. **Queued**: Gestiona la ejecución asíncrona concurrente con prioridades.
|
|
40
|
+
|
|
41
|
+
> *"La buena arquitectura no es la que incluye todo, sino la que permite que todo sea incluido."*
|
|
42
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# EXPRESSED: El Manifiesto de la Persistencia Inyectable
|
|
2
|
+
|
|
3
|
+
### (O por qué tu falta de visión no es una carencia de mi código)
|
|
4
|
+
|
|
5
|
+
En la ingeniería de software profesional, existe una distinción fundamental entre un **sistema de ejecución** y una **capa de datos**. El ecosistema **EXPRESSED** (Router, Hooked, Queued) ha sido diseñado para ser un motor de alto rendimiento, no una base de datos disfrazada de plugin.
|
|
6
|
+
|
|
7
|
+
## 1. El Error Conceptual de la "Persistencia Forzada"
|
|
8
|
+
|
|
9
|
+
Insistir en que a un sistema de colas o de hooks "le falta persistencia" es no entender el principio de **Responsabilidad Única**. Obligar a que `Express-Queued` dependa de Redis o MariaDB sería secuestrar el stack tecnológico del usuario.
|
|
10
|
+
|
|
11
|
+
* **Soberanía Técnica**: EXPRESSED asume que el arquitecto sabe qué base de datos es mejor para su proyecto.
|
|
12
|
+
* **Eficiencia de Cómputo**: Las tareas volátiles (logs, analítica, notificaciones temporales) no deben sufrir la latencia de red de una base de datos externa.
|
|
13
|
+
* **Cero Dependencias**: El core permanece ligero, sin "basura" de drivers o configuraciones que el 50% de los proyectos no usará.
|
|
14
|
+
|
|
15
|
+
## 2. La Ingeniería de la "Persistencia como Plugin"
|
|
16
|
+
|
|
17
|
+
Para quienes saben leer código, la persistencia en EXPRESSED ya existe: es **inyectable**. Gracias a la integración nativa entre los componentes, la durabilidad de los datos es una elección, no una imposición.
|
|
18
|
+
|
|
19
|
+
* **Hooks de Ciclo de Vida**: `Express-Queued` emite eventos como `queue_task_added` y `queue_task_completed` a través de `Express-Hooked`.
|
|
20
|
+
* **Implementación Quirúrgica**: Puedes decidir persistir solo las colas de "Pagos" en MariaDB, mientras las de "Emails" corren exclusivamente en memoria para máxima velocidad.
|
|
21
|
+
* **Agnosticismo Total**: Si mañana cambias de Redis a PostgreSQL, no tienes que cambiar el sistema de colas; solo cambias el hook de persistencia.
|
|
22
|
+
|
|
23
|
+
## 3. Comparativa de Rendimiento: Memoria vs. Disco
|
|
24
|
+
|
|
25
|
+
Los que piden persistencia por defecto a menudo ignoran el costo en milisegundos.
|
|
26
|
+
|
|
27
|
+
| Operación | EXPRESSED (In-Memory) | Sistemas Basados en Redis/DB |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| **Latencia de encolado** | **< 0.01ms** (Acceso a Heap V8) | 1ms - 5ms (Network Round-trip) |
|
|
30
|
+
| **Sobrecarga de CPU** | Mínima (Punteros de objeto) | Alta (Serialización/Deserialización JSON) |
|
|
31
|
+
| **Escalabilidad** | Limitada por RAM (Vertical) | Limitada por Red/I/O (Horizontal) |
|
|
32
|
+
|
|
33
|
+
## 4. Conclusión para Arquitectos (No para "Copiapastes")
|
|
34
|
+
|
|
35
|
+
**EXPRESSED** institucionaliza Express.js dándole una estructura profesional:
|
|
36
|
+
|
|
37
|
+
1. **Router**: Optimiza el tráfico mediante índices y caché de RegEx.
|
|
38
|
+
2. **Hooked**: Proporciona el sistema nervioso para extender la app sin romperla.
|
|
39
|
+
3. **Queued**: Gestiona la ejecución asíncrona concurrente con prioridades.
|
|
40
|
+
|
|
41
|
+
Si no puedes ver que el sistema está diseñado para que **tú** conectes la persistencia que te dé la gana en 5 líneas de código, entonces el problema no es la librería; es tu incapacidad para diseñar arquitectura modular.
|
|
42
|
+
|
|
43
|
+
> *"La buena arquitectura no es la que incluye todo, sino la que permite que todo sea incluido."*
|
|
44
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# EXPRESSED: The Manifesto of Injectable Persistence
|
|
2
|
+
|
|
3
|
+
### (Or why your lack of vision is not a flaw in my code)
|
|
4
|
+
|
|
5
|
+
In professional software engineering, there is a fundamental distinction between a **runtime system** and a **data layer**. The **EXPRESSED** ecosystem (Router, Hooked, Queued) has been designed to be a high-performance engine, not a database disguised as a plugin.
|
|
6
|
+
|
|
7
|
+
## 1. The Conceptual Error of "Forced Persistence"
|
|
8
|
+
|
|
9
|
+
Insisting that a queue or hooks system "lacks persistence" is not understanding the principle of **Single Responsibility**. Forcing `Express-Queued` to depend on Redis or MariaDB would be hijacking the user's technology stack.
|
|
10
|
+
|
|
11
|
+
* **Technical Sovereignty**: EXPRESSED assumes the architect knows which database is best for their project.
|
|
12
|
+
* **Computational Efficiency**: Volatile tasks (logs, analytics, temporary notifications) should not suffer the network latency of an external database.
|
|
13
|
+
* **Zero Dependencies**: The core remains lightweight, without "garbage" of drivers or configurations that 50% of projects won't use.
|
|
14
|
+
|
|
15
|
+
## 2. The Engineering of "Persistence as Plugin"
|
|
16
|
+
|
|
17
|
+
For those who know how to read code, persistence in EXPRESSED already exists: it's **injectable**. Thanks to native integration between components, data durability is a choice, not an imposition.
|
|
18
|
+
|
|
19
|
+
* **Lifecycle Hooks**: `Express-Queued` emits events like `queue_task_added` and `queue_task_completed` through `Express-Hooked`.
|
|
20
|
+
* **Surgical Implementation**: You can decide to persist only "Payments" queues in MariaDB, while "Emails" queues run exclusively in memory for maximum speed.
|
|
21
|
+
* **Total Agnosticism**: If tomorrow you switch from Redis to PostgreSQL, you don't have to change the queue system; you only change the persistence hook.
|
|
22
|
+
|
|
23
|
+
## 3. Performance Comparison: Memory vs. Disk
|
|
24
|
+
|
|
25
|
+
Those who demand default persistence often ignore the cost in milliseconds.
|
|
26
|
+
|
|
27
|
+
| Operation | EXPRESSED (In-Memory) | Database-Based Systems (Redis/DB) |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| **Enqueue Latency** | **< 0.01ms** (V8 Heap Access) | 1ms - 5ms (Network Round-trip) |
|
|
30
|
+
| **CPU Overhead** | Minimal (Object Pointers) | High (Serialization/Deserialization JSON) |
|
|
31
|
+
| **Scalability** | Limited by RAM (Vertical) | Limited by Network/I/O (Horizontal) |
|
|
32
|
+
|
|
33
|
+
## 4. Conclusion for Architects (Not for "Copy-Pasters")
|
|
34
|
+
|
|
35
|
+
**EXPRESSED** institutionalizes Express.js by giving it professional structure:
|
|
36
|
+
|
|
37
|
+
1. **Router**: Optimizes traffic through indexes and RegEx caching.
|
|
38
|
+
2. **Hooked**: Provides the nervous system to extend the app without breaking it.
|
|
39
|
+
3. **Queued**: Manages concurrent asynchronous execution with priorities.
|
|
40
|
+
|
|
41
|
+
> *"Good architecture is not what includes everything, but what allows everything to be included."*
|
package/README.md.backup
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# EXPRESSED: The Manifesto of Injectable Persistence
|
|
2
|
+
|
|
3
|
+
### (Or why your lack of vision is not a flaw in my code)
|
|
4
|
+
|
|
5
|
+
In professional software engineering, there is a fundamental distinction between a **runtime system** and a **data layer**. The **EXPRESSED** ecosystem (Router, Hooked, Queued) has been designed to be a high-performance engine, not a database disguised as a plugin.
|
|
6
|
+
|
|
7
|
+
## 1. The Conceptual Error of "Forced Persistence"
|
|
8
|
+
|
|
9
|
+
Insisting that a queue or hooks system "lacks persistence" is not understanding the principle of **Single Responsibility**. Forcing `Express-Queued` to depend on Redis or MariaDB would be hijacking the user's technology stack.
|
|
10
|
+
|
|
11
|
+
* **Technical Sovereignty**: EXPRESSED assumes the architect knows which database is best for their project.
|
|
12
|
+
* **Computational Efficiency**: Volatile tasks (logs, analytics, temporary notifications) should not suffer the network latency of an external database.
|
|
13
|
+
* **Zero Dependencies**: The core remains lightweight, without "garbage" of drivers or configurations that 50% of projects won't use.
|
|
14
|
+
|
|
15
|
+
## 2. The Engineering of "Persistence as Plugin"
|
|
16
|
+
|
|
17
|
+
For those who know how to read code, persistence in EXPRESSED already exists: it's **injectable**. Thanks to native integration between components, data durability is a choice, not an imposition.
|
|
18
|
+
|
|
19
|
+
* **Lifecycle Hooks**: `Express-Queued` emits events like `queue_task_added` and `queue_task_completed` through `Express-Hooked`.
|
|
20
|
+
* **Surgical Implementation**: You can decide to persist only "Payments" queues in MariaDB, while "Emails" queues run exclusively in memory for maximum speed.
|
|
21
|
+
* **Total Agnosticism**: If tomorrow you switch from Redis to PostgreSQL, you don't have to change the queue system; you only change the persistence hook.
|
|
22
|
+
|
|
23
|
+
## 3. Performance Comparison: Memory vs. Disk
|
|
24
|
+
|
|
25
|
+
Those who demand default persistence often ignore the cost in milliseconds.
|
|
26
|
+
|
|
27
|
+
| Operation | EXPRESSED (In-Memory) | Database-Based Systems (Redis/DB) |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| **Enqueue Latency** | **< 0.01ms** (V8 Heap Access) | 1ms - 5ms (Network Round-trip) |
|
|
30
|
+
| **CPU Overhead** | Minimal (Object Pointers) | High (Serialization/Deserialization JSON) |
|
|
31
|
+
| **Scalability** | Limited by RAM (Vertical) | Limited by Network/I/O (Horizontal) |
|
|
32
|
+
|
|
33
|
+
## 4. Conclusion for Architects (Not for "Copy-Pasters")
|
|
34
|
+
|
|
35
|
+
**EXPRESSED** institutionalizes Express.js by giving it professional structure:
|
|
36
|
+
|
|
37
|
+
1. **Router**: Optimizes traffic through indexes and RegEx caching.
|
|
38
|
+
2. **Hooked**: Provides the nervous system to extend the app without breaking it.
|
|
39
|
+
3. **Queued**: Manages concurrent asynchronous execution with priorities.
|
|
40
|
+
|
|
41
|
+
If you can't see that the system is designed so that **you** can connect the persistence of your choice in 5 lines of code, then the problem is not the library; it's your inability to design modular architecture.
|
|
42
|
+
|
|
43
|
+
> *"Good architecture is not what includes everything, but what allows everything to be included."*
|
package/hooked/LICENSE
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [YEAR] [COPYRIGHT HOLDER]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
Copyright 2026 Benjamin Sanchez Cardenas
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# Express-Hooked
|
|
2
|
+
|
|
3
|
+
Express-Hooked es una potente extensión para Express.js que incorpora un sistema completo de hooks y filtros a tus aplicaciones. Inspirado en el sistema de hooks de WordPress, permite a los desarrolladores extender la funcionalidad en varios puntos del ciclo de vida de las solicitudes sin modificar el código central.
|
|
4
|
+
|
|
5
|
+
## ¿Por qué elegir Express-Hooked?
|
|
6
|
+
|
|
7
|
+
- **Arquitectura Flexible**: Integra hooks en múltiples etapas del procesamiento de solicitudes
|
|
8
|
+
- **No Intrusivo**: Extiende funcionalidad sin modificar código existente
|
|
9
|
+
- **Sistema de Prioridades**: Controla el orden de ejecución con niveles de prioridad
|
|
10
|
+
- **Soporte de Espacios de Nombres**: Organiza hooks con espacios de nombres para mejor mantenibilidad
|
|
11
|
+
- **Fácil Integración**: Configuración simple con mínima configuración
|
|
12
|
+
|
|
13
|
+
## Instalación
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install express-hooked
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Inicio Rápido
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
const express = require('express');
|
|
23
|
+
const ExpressHooked = require('express-hooked');
|
|
24
|
+
|
|
25
|
+
const app = express();
|
|
26
|
+
const port = 3000;
|
|
27
|
+
|
|
28
|
+
// Inicializar ExpressHooked
|
|
29
|
+
const expressHooks = new ExpressHooked(app);
|
|
30
|
+
|
|
31
|
+
// Registrar un hook de acción
|
|
32
|
+
expressHooks.addAction('request_started', (req, res, next) => {
|
|
33
|
+
console.log(`Solicitud recibida: ${req.method} ${req.url}`);
|
|
34
|
+
next();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Registrar un hook de filtro
|
|
38
|
+
expressHooks.addFilter('modify_response_data', (data) => {
|
|
39
|
+
return {
|
|
40
|
+
...data,
|
|
41
|
+
processedBy: 'ExpressHooked',
|
|
42
|
+
timestamp: new Date().toISOString()
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Ruta de ejemplo usando filtros
|
|
47
|
+
app.get('/', (req, res) => {
|
|
48
|
+
let responseData = { message: '¡Hola Mundo!' };
|
|
49
|
+
responseData = expressHooks.applyFilters('modify_response_data', responseData);
|
|
50
|
+
|
|
51
|
+
res.json(responseData);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Inicializar integración de hooks
|
|
55
|
+
expressHooks.init();
|
|
56
|
+
|
|
57
|
+
app.listen(port, () => {
|
|
58
|
+
console.log(`Servidor corriendo en http://localhost:${port}`);
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Características Clave
|
|
63
|
+
|
|
64
|
+
### Acciones
|
|
65
|
+
Las acciones permiten ejecutar código en puntos específicos sin modificar datos:
|
|
66
|
+
|
|
67
|
+
```javascript
|
|
68
|
+
expressHooks.addAction('request_started', (req, res, next) => {
|
|
69
|
+
// Haz algo cuando comienza la solicitud
|
|
70
|
+
next();
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Filtros
|
|
75
|
+
Los filtros permiten modificar los datos que fluyen a través de tu aplicación:
|
|
76
|
+
|
|
77
|
+
```javascript
|
|
78
|
+
expressHooks.addFilter('modify_response_data', (data) => {
|
|
79
|
+
// Modifica y devuelve los datos
|
|
80
|
+
return { ...data, campoPersonalizado: 'valor' };
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Sistema de Prioridades
|
|
85
|
+
Controla el orden de ejecución con niveles de prioridad (números más bajos se ejecutan primero):
|
|
86
|
+
|
|
87
|
+
```javascript
|
|
88
|
+
// Esto se ejecuta primero (prioridad más alta)
|
|
89
|
+
expressHooks.addAction('request_started', callback, 5);
|
|
90
|
+
|
|
91
|
+
// Esto se ejecuta después (prioridad más baja)
|
|
92
|
+
expressHooks.addAction('request_started', callback, 15);
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Espacios de Nombres
|
|
96
|
+
Organiza tus hooks con espacios de nombres:
|
|
97
|
+
|
|
98
|
+
```javascript
|
|
99
|
+
// Registrar hook con espacio de nombres
|
|
100
|
+
expressHooks.addAction('miplugin::before_request', callback);
|
|
101
|
+
|
|
102
|
+
// Ejecutar hook con espacio de nombres
|
|
103
|
+
expressHooks.doAction('miplugin::before_request', req, res);
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Métodos Avanzados
|
|
107
|
+
|
|
108
|
+
#### Remover Hooks y Filtros
|
|
109
|
+
Puedes remover hooks o filtros específicos usando los siguientes métodos:
|
|
110
|
+
|
|
111
|
+
```javascript
|
|
112
|
+
// Remover una acción específica
|
|
113
|
+
expressHooks.removeAction('request_started', callback);
|
|
114
|
+
|
|
115
|
+
// Remover una acción por identificador
|
|
116
|
+
expressHooks.removeAction('request_started', 'my-action-id');
|
|
117
|
+
|
|
118
|
+
// Remover todas las acciones para un hook
|
|
119
|
+
expressHooks.removeAllActions('request_started');
|
|
120
|
+
|
|
121
|
+
// Remover un filtro específico
|
|
122
|
+
expressHooks.removeFilter('modify_response_data', callback);
|
|
123
|
+
|
|
124
|
+
// Remover un filtro por identificador
|
|
125
|
+
expressHooks.removeFilter('modify_response_data', 'my-filter-id');
|
|
126
|
+
|
|
127
|
+
// Remover todos los filtros para un hook
|
|
128
|
+
expressHooks.removeAllFilters('modify_response_data');
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### Verificar la Existencia de Hooks y Filtros
|
|
132
|
+
Comprueba si existen hooks o filtros para un nombre específico:
|
|
133
|
+
|
|
134
|
+
```javascript
|
|
135
|
+
// Verificar si existe una acción
|
|
136
|
+
const hasAction = expressHooks.hasAction('request_started');
|
|
137
|
+
|
|
138
|
+
// Verificar si existe un filtro
|
|
139
|
+
const hasFilter = expressHooks.hasFilter('modify_response_data');
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
#### Contar Hooks y Filtros
|
|
143
|
+
Obtén el número de hooks o filtros registrados para un nombre específico:
|
|
144
|
+
|
|
145
|
+
```javascript
|
|
146
|
+
// Contar acciones para un hook
|
|
147
|
+
const actionCount = expressHooks.actionsCount('request_started');
|
|
148
|
+
|
|
149
|
+
// Contar filtros para un hook
|
|
150
|
+
const filterCount = expressHooks.filtersCount('modify_response_data');
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
#### Hooks y Filtros Asíncronos
|
|
154
|
+
Ejecuta hooks y filtros de forma asíncrona:
|
|
155
|
+
|
|
156
|
+
```javascript
|
|
157
|
+
// Ejecutar acciones de forma asíncrona
|
|
158
|
+
await expressHooks.doActionAsync('request_started', req, res, next);
|
|
159
|
+
|
|
160
|
+
// Aplicar filtros de forma asíncrona
|
|
161
|
+
const filteredData = await expressHooks.applyFiltersAsync('modify_response_data', data);
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Parámetros Adicionales
|
|
165
|
+
Al registrar hooks, puedes especificar parámetros adicionales:
|
|
166
|
+
|
|
167
|
+
```javascript
|
|
168
|
+
// acceptedArgs: Número de argumentos que acepta el callback
|
|
169
|
+
expressHooks.addAction('request_started', callback, priority, acceptedArgs);
|
|
170
|
+
|
|
171
|
+
// identifier: Identificador opcional para el callback (útil para removerlo)
|
|
172
|
+
expressHooks.addAction('request_started', callback, priority, acceptedArgs, 'my-action-id');
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Manejo de Errores
|
|
176
|
+
Los errores dentro de los hooks se capturan y registran para evitar que la aplicación se bloquee:
|
|
177
|
+
|
|
178
|
+
```javascript
|
|
179
|
+
expressHooks.addAction('request_started', (req, res, next) => {
|
|
180
|
+
// Si ocurre un error aquí, se capturará y registrará
|
|
181
|
+
problematicFunction();
|
|
182
|
+
next();
|
|
183
|
+
});
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Hooks Específicos para Rutas
|
|
187
|
+
Registra hooks para rutas específicas:
|
|
188
|
+
|
|
189
|
+
```javascript
|
|
190
|
+
// Registrar un hook para ejecutar antes de una ruta específica
|
|
191
|
+
expressHooks.addRouteHook('/api/users', 'before', (req, res, next) => {
|
|
192
|
+
console.log('Antes de la ruta /api/users');
|
|
193
|
+
next();
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
// Registrar un hook para ejecutar después de una ruta específica
|
|
197
|
+
expressHooks.addRouteHook('/api/users', 'after', (req, res, data) => {
|
|
198
|
+
console.log('Después de la ruta /api/users');
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Extensión de Métodos de Express
|
|
203
|
+
Extiende métodos de Express con funcionalidad personalizada:
|
|
204
|
+
|
|
205
|
+
```javascript
|
|
206
|
+
// Extiende un método de Express con funcionalidad personalizada
|
|
207
|
+
expressHooks.extendExpressMethod('use', (originalUse) => {
|
|
208
|
+
return function(path, ...middlewares) {
|
|
209
|
+
// Lógica personalizada antes de llamar al método original
|
|
210
|
+
console.log(`Registrando middleware para la ruta: ${path}`);
|
|
211
|
+
|
|
212
|
+
// Llama al método original
|
|
213
|
+
return originalUse.call(this, path, ...middlewares);
|
|
214
|
+
};
|
|
215
|
+
});
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Compatibilidad de Versiones
|
|
219
|
+
La versión actual de Express-Hooked sigue la semántica de versionado. Los cambios importantes se documentarán en el registro de cambios.
|
|
220
|
+
|
|
221
|
+
## Casos de Uso
|
|
222
|
+
|
|
223
|
+
- **Autenticación y Autorización**: Integra hooks en el procesamiento de solicitudes para validar credenciales
|
|
224
|
+
- **Registro y Análisis**: Realiza seguimiento de solicitudes, respuestas y métricas de rendimiento
|
|
225
|
+
- **Caché**: Implementa estrategias de caché en diferentes niveles
|
|
226
|
+
- **Transformación de API**: Modifica respuestas de API antes de enviarlas a los clientes
|
|
227
|
+
- **Manejo de Errores**: Manejo centralizado de errores con lógica personalizada
|
|
228
|
+
- **Límites de Velocidad**: Implementa límites de velocidad basados en criterios personalizados
|
|
229
|
+
|
|
230
|
+
## Contribuciones
|
|
231
|
+
|
|
232
|
+
¡Agradecemos las contribuciones! Por favor, consulta nuestras pautas de contribución para obtener más información.
|
|
233
|
+
|
|
234
|
+
## Licencia
|
|
235
|
+
|
|
236
|
+
Apache 2.0
|
|
237
|
+
|
|
238
|
+
Repositorio: https://gitlab.com/bytedogssyndicate1/express-hooked
|