{"id":15835832,"url":"https://github.com/kaelzhang/tapable-proxy","last_synced_at":"2025-04-01T12:47:00.416Z","repository":{"id":65514479,"uuid":"187848482","full_name":"kaelzhang/tapable-proxy","owner":"kaelzhang","description":"The pseudo tapable based on Proxy","archived":false,"fork":false,"pushed_at":"2019-08-28T13:17:59.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T13:16:19.377Z","etag":null,"topics":["fake","hooks","proxy","tapable"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaelzhang.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","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":"2019-05-21T13:58:41.000Z","updated_at":"2019-08-28T13:18:00.000Z","dependencies_parsed_at":"2023-01-26T21:16:00.344Z","dependency_job_id":null,"html_url":"https://github.com/kaelzhang/tapable-proxy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Ftapable-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Ftapable-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Ftapable-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Ftapable-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaelzhang","download_url":"https://codeload.github.com/kaelzhang/tapable-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246397403,"owners_count":20770548,"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":["fake","hooks","proxy","tapable"],"created_at":"2024-10-05T14:41:47.288Z","updated_at":"2025-04-01T12:47:00.395Z","avatar_url":"https://github.com/kaelzhang.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/kaelzhang/tapable-proxy.svg?branch=master)](https://travis-ci.org/kaelzhang/tapable-proxy)\n[![Coverage](https://codecov.io/gh/kaelzhang/tapable-proxy/branch/master/graph/badge.svg)](https://codecov.io/gh/kaelzhang/tapable-proxy)\n\u003c!-- optional appveyor tst\n[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/kaelzhang/tapable-proxy?branch=master\u0026svg=true)](https://ci.appveyor.com/project/kaelzhang/tapable-proxy)\n--\u003e\n\u003c!-- optional npm version\n[![NPM version](https://badge.fury.io/js/tapable-proxy.svg)](http://badge.fury.io/js/tapable-proxy)\n--\u003e\n\u003c!-- optional npm downloads\n[![npm module downloads per month](http://img.shields.io/npm/dm/tapable-proxy.svg)](https://www.npmjs.org/package/tapable-proxy)\n--\u003e\n\u003c!-- optional dependency status\n[![Dependency Status](https://david-dm.org/kaelzhang/tapable-proxy.svg)](https://david-dm.org/kaelzhang/tapable-proxy)\n--\u003e\n\n# tapable-proxy\n\nThe pseudo tapable based on [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy). `tapable-proxy` could create fake hooks which can be tapped even before the creation of real hooks.\n\n## Install\n\n```sh\n$ npm i tapable-proxy\n```\n\n## Usage\n\n```js\nconst {\n  create,\n  APPLY_TAPS,\n  SET_HOOKS\n} = require('tapable-proxy')\n\n// Create a fake hook proxy\nconst hooks = create()\n\nhooks.afterEmit.tap('MyPlugin', compilation =\u003e {\n  // ...\n})\n\n// Apply all taps to webpack compiler hooks\nhooks[APPLY_TAPS](compiler.hooks)\n\n// Proxy the follow-up taps to compiler hooks\nhooks[SET_HOOKS](compiler.hooks)\n```\n\n### hooks\\[APPLY_TAPS](realHooks, clean)\n\n- **realHooks** `{[string]: Tapable}` the real [tapable](https://www.npmjs.com/package/tapable) hooks\n- **clean?** `boolean=true` If `true`, the tapped handlers will be maintained after applied. Defaults to `true`\n\n### hooks\\[SET_HOOKS](realHooks)\n\nSet the underlying hooks of the proxy as `realHooks`, and after that follop-up taps will directly tap into `realHooks`.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Ftapable-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaelzhang%2Ftapable-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Ftapable-proxy/lists"}