{"id":17965355,"url":"https://github.com/t2ym/thin-wrap","last_synced_at":"2025-04-03T20:17:51.536Z","repository":{"id":58231629,"uuid":"79422151","full_name":"t2ym/thin-wrap","owner":"t2ym","description":"Thin Class Wrapper","archived":false,"fork":false,"pushed_at":"2017-01-19T13:34:25.000Z","size":12,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T10:41:26.474Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/t2ym.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-19T06:19:54.000Z","updated_at":"2017-01-19T13:15:15.000Z","dependencies_parsed_at":"2022-08-31T03:30:12.555Z","dependency_job_id":null,"html_url":"https://github.com/t2ym/thin-wrap","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/t2ym%2Fthin-wrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2ym%2Fthin-wrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2ym%2Fthin-wrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2ym%2Fthin-wrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t2ym","download_url":"https://codeload.github.com/t2ym/thin-wrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247070927,"owners_count":20878586,"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-29T12:41:53.772Z","updated_at":"2025-04-03T20:17:51.515Z","avatar_url":"https://github.com/t2ym.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/thin-wrap.svg)](https://www.npmjs.com/package/thin-wrap)\n[![Bower](https://img.shields.io/bower/v/thin-wrap.svg)](https://customelements.io/t2ym/thin-wrap/)\n\n# thin-wrap\n\nThin Class Wrapper (experimental)\n\n```javascript\nfunction loggerForwarder(prop, f, args, self, newTarget) { \n  console.log('wrap: ' + (newTarget ? 'new ' : '') + f.name + ' is called for ', (self \u0026\u0026 self.name ? self.name : self), 'with arguments', args);\n  return newTarget ? Reflect.construct(f, args) : f.apply(self, args);\n}\nwrap(XMLHttpRequest, loggerForwarder);\nwrap(EventTarget, loggerForwarder);\n```\n\n## Install\n\n### Browsers\n\n```sh\n  bower install --save thin-wrap\n```\n\n### NodeJS\n\n```sh\n  npm install --save thin-wrap\n```\n\n## Import\n\n### Browsers\n\n```html\n\u003cscript src=\"path/to/bower_components/thin-wrap/wrap.js\"\u003e\u003c/script\u003e\n```\n\n### NodeJS\n\n```javascript\nconst wrap = require('thin-wrap/wrap.js');\n```\n\n## API\n\nTBD\n\n## Advantages\n\n- Small overheads (Significantly faster than ES6 Proxy)\n- `this` is unique and identical for each instance\n\n## Known Limitations\n\n### Architectural Limitations\n\n- `Class !== Class.prototype.constructor`\n- `new Class()` is not trackable\n- `new Class.prototype.constructor()` or `new (wrap(Class))()` is trackable\n- Properties without setter/getter are not trackable\n\n### Current Design Limitations\n\n- Inherited properties are not tracked\n- Generation of setter/getter for properties are not implemented\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/thin-wrap/blob/master/LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft2ym%2Fthin-wrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft2ym%2Fthin-wrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft2ym%2Fthin-wrap/lists"}