{"id":17766569,"url":"https://github.com/floatdrop/wrap-middleware","last_synced_at":"2025-04-01T13:45:13.365Z","repository":{"id":30379923,"uuid":"33932555","full_name":"floatdrop/wrap-middleware","owner":"floatdrop","description":"Wraps middleware","archived":false,"fork":false,"pushed_at":"2015-04-14T16:03:36.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T09:19:30.055Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/floatdrop.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-14T13:14:34.000Z","updated_at":"2015-04-14T16:03:34.000Z","dependencies_parsed_at":"2022-08-22T08:20:15.122Z","dependency_job_id":null,"html_url":"https://github.com/floatdrop/wrap-middleware","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fwrap-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fwrap-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fwrap-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fwrap-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floatdrop","download_url":"https://codeload.github.com/floatdrop/wrap-middleware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246651508,"owners_count":20811991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-26T20:32:31.685Z","updated_at":"2025-04-01T13:45:13.337Z","avatar_url":"https://github.com/floatdrop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wrap-middleware [![Build Status](https://travis-ci.org/floatdrop/wrap-middleware.svg?branch=master)](https://travis-ci.org/floatdrop/wrap-middleware)\n\nWraps middleware and provide way to attach code before and after it.\n\n## Install\n\n```\n$ npm install --save wrap-middleware\n```\n\n\n## Usage\n\n```js\nvar wrapMiddleware = require('wrap-middleware');\nvar myMw = function (req, res, next) { next(); };\n\nwrapMiddleware(myMw)\n\t.before(function (req, res, next) {\n\t\t// Called before\n\t})\n\t.after(function (req, res, next) {\n\t\t// Called after\n\t});\n//=\u003e wrapped middleware\n```\n\n\n## API\n\n### wrapMiddleware(middleware)\n\n#### middleware\n\n*Required*  \nType: `Function`\n\nMiddleware, that should be wrapped.\n\n#### .before(cb)\n\nAttaches `cb`, that will be called _before_ wrapped middleware.\n\n#### .after(cb)\n\nAttaches `cb`, that will be called _after_ wrapped middleware.\n\n## License\n\nMIT © [Vsevolod Strukchinsky](http://github.yandex-team.ru/floatdrop)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatdrop%2Fwrap-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloatdrop%2Fwrap-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatdrop%2Fwrap-middleware/lists"}