{"id":21193641,"url":"https://github.com/danielmschmidt/javascript-proxy-aop","last_synced_at":"2025-03-14T21:17:26.157Z","repository":{"id":57279595,"uuid":"59428699","full_name":"DanielMSchmidt/javascript-proxy-aop","owner":"DanielMSchmidt","description":"AOP through Proxies","archived":false,"fork":false,"pushed_at":"2018-05-22T07:35:23.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T12:38:05.688Z","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/DanielMSchmidt.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":"2016-05-22T18:49:40.000Z","updated_at":"2016-05-22T18:50:14.000Z","dependencies_parsed_at":"2022-09-18T14:31:57.512Z","dependency_job_id":null,"html_url":"https://github.com/DanielMSchmidt/javascript-proxy-aop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMSchmidt%2Fjavascript-proxy-aop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMSchmidt%2Fjavascript-proxy-aop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMSchmidt%2Fjavascript-proxy-aop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMSchmidt%2Fjavascript-proxy-aop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanielMSchmidt","download_url":"https://codeload.github.com/DanielMSchmidt/javascript-proxy-aop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243646698,"owners_count":20324587,"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-11-20T19:15:07.466Z","updated_at":"2025-03-14T21:17:26.137Z","avatar_url":"https://github.com/DanielMSchmidt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# javascript-proxy-aop [![Build Status](https://travis-ci.org/DanielMSchmidt/javascript-proxy-aop.svg?branch=master)](https://travis-ci.org/DanielMSchmidt/javascript-proxy-aop) [![Coverage Status](https://coveralls.io/repos/github/DanielMSchmidt/javascript-proxy-aop/badge.svg?branch=master)](https://coveralls.io/github/DanielMSchmidt/javascript-proxy-aop?branch=master)\n\n\u003e Uses ES6 Proxy to instrument JS in an (unfortunately too verbose) aspect-oriented way\n\n\n## Install\n\n```\n$ npm install --save javascript-proxy-aop\n```\n\n\n## Usage\n\n```js\nconst javascriptProxyAop = require('javascript-proxy-aop');\n\n// pubSub may be any object that supports trigger\nconst instrument = javascriptProxyAop(pubSub);\n\nconst obj = instrument({\n\tmethod: function() {},\n\tanotherMethod: function fooBar() {}\n});\n\nobj.method(['hello', 'world']);\n// =\u003e pubSub.on('onBeforeMethod', method, args) is called\n//\t\t=\u003e method: 'anonymous\u003cmethod\u003e'\n//\t\t=\u003e args: [['hello', 'world']]\n// =\u003e pubSub.on('onAfterMethod', method, args) is called\n//\t\t=\u003e method: 'anonymous\u003cmethod\u003e'\n//\t\t=\u003e args: [['hello', 'world']]\n//\t\t=\u003e result: undefined\n\nobj.anotherMethod(); // method is 'fooBar'\n```\n\n## TODO\n\n- [ ] enable to instrument functions directly\n\n\n## License\n\nMIT © [Daniel Schmidt](http://danielmschmidt.de)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielmschmidt%2Fjavascript-proxy-aop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielmschmidt%2Fjavascript-proxy-aop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielmschmidt%2Fjavascript-proxy-aop/lists"}