{"id":15662204,"url":"https://github.com/negezor/middleware-io","last_synced_at":"2025-08-20T22:30:58.045Z","repository":{"id":26399048,"uuid":"108724625","full_name":"negezor/middleware-io","owner":"negezor","description":"⛓️ Modern middleware with promises","archived":false,"fork":false,"pushed_at":"2024-06-16T12:57:01.000Z","size":1369,"stargazers_count":20,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-10T05:42:07.591Z","etag":null,"topics":["middleware","promise"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/negezor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-29T10:29:26.000Z","updated_at":"2024-11-29T23:39:50.000Z","dependencies_parsed_at":"2024-06-18T17:04:30.710Z","dependency_job_id":"9c00e305-e58f-48d3-a88c-131891e78c35","html_url":"https://github.com/negezor/middleware-io","commit_stats":{"total_commits":168,"total_committers":2,"mean_commits":84.0,"dds":"0.011904761904761862","last_synced_commit":"ae3a9c931e6d1c05d7408ddfa7f3cd8aadbd0606"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negezor%2Fmiddleware-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negezor%2Fmiddleware-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negezor%2Fmiddleware-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negezor%2Fmiddleware-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/negezor","download_url":"https://codeload.github.com/negezor/middleware-io/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230462906,"owners_count":18229864,"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":["middleware","promise"],"created_at":"2024-10-03T13:30:41.302Z","updated_at":"2024-12-19T16:10:44.752Z","avatar_url":"https://github.com/negezor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/negezor/middleware-io/master/logo.svg?sanitize=true\"\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/negezor/middleware-io/actions/workflows/tests.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/negezor/middleware-io/tests.yml?style=flat-square\" alt=\"Build Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/middleware-io\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/middleware-io.svg?style=flat-square\" alt=\"NPM version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/middleware-io\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/middleware-io.svg?style=flat-square\" alt=\"NPM downloads\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e **Middleware-IO** - Modern middleware on Promise\n\n| 📖 [Documentation](docs/) |\n|---------------------------|\n\n## Features\n\n1. **Self-Sufficient.** The library has zero dependencies.\n2. **Reliable.** The library is written in **TypeScript** and covered by tests.\n3. **Modern.** The library comes with native ESM support\n3. **Powerful.** Supports following additional features:\n    - The library has enough built-in snippets;\n    - The middleware chain builder;\n\n## Installation\n\u003e **[Node.js](https://nodejs.org/) 12.0.0 or newer is required**\n\n- **Using `npm`** (recommended)\n    ```shell\n    npm i middleware-io\n    ```\n- **Using `Yarn`**\n  ```shell\n  yarn add middleware-io\n  ```\n- **Using `pnpm`**\n  ```shell\n  pnpm add middleware-io\n  ```\n\n## Example usage\n\n```js\nimport { compose } from 'middleware-io';\n\nconst composedMiddleware = compose([\n    async (context, next) =\u003e {\n        // Step 1\n\n        await next();\n\n        // Step 4\n\n        // Print the current date from the next middleware\n        console.log(context.now);\n    },\n    async (context, next) =\u003e {\n        // Step 2\n\n        context.now = Date.now();\n\n        await next();\n\n        // Step 3\n    }\n]);\n\ncomposedMiddleware({}, () =\u003e { /* Last handler (next) */ })\n    .then(() =\u003e {\n        console.log('Middleware finished work');\n    })\n    .catch(console.error);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnegezor%2Fmiddleware-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnegezor%2Fmiddleware-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnegezor%2Fmiddleware-io/lists"}