{"id":17419804,"url":"https://github.com/bendrucker/proxyquire-universal","last_synced_at":"2025-04-15T00:00:23.171Z","repository":{"id":22146002,"uuid":"25477161","full_name":"bendrucker/proxyquire-universal","owner":"bendrucker","description":"Proxyquire in Node and Proxyquireify in the browser with no code changes","archived":false,"fork":false,"pushed_at":"2022-04-21T17:43:31.000Z","size":58,"stargazers_count":35,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T08:14:05.106Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bendrucker.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":"2014-10-20T17:10:42.000Z","updated_at":"2024-06-29T04:12:34.000Z","dependencies_parsed_at":"2022-08-20T21:40:31.449Z","dependency_job_id":null,"html_url":"https://github.com/bendrucker/proxyquire-universal","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fproxyquire-universal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fproxyquire-universal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fproxyquire-universal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fproxyquire-universal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendrucker","download_url":"https://codeload.github.com/bendrucker/proxyquire-universal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981263,"owners_count":21193145,"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-17T02:33:36.716Z","updated_at":"2025-04-15T00:00:23.118Z","avatar_url":"https://github.com/bendrucker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# proxyquire-universal [![tests](https://github.com/bendrucker/proxyquire-universal/workflows/tests/badge.svg)](https://github.com/bendrucker/proxyquire-universal/actions?query=workflow%3Atests)\n\nBrowserify plugin that allows you to replace [proxyquire](https://github.com/thlorenz/proxyquire) with [proxyquireify](https://github.com/thlorenz/proxyquireify) without code changes. If you only need to run your tests in a browser, just use [proxyquireify](https://github.com/thlorenz/proxyquireify) directly. Make sure you're not using [proxyquire features that don't have proxyquireify counterparts](#unsupported-proxyquire-features).\n\n## Installing\n\n```sh\n$ npm install --save-dev proxyquire-universal proxyquire proxyquireify\n```\nproxyquire-universal sets proxyquire and proxyquireify as peer dependencies so all three packages will be siblings in your `node_modules` folder. You have full control over which versions are used.\n\n## Usage\n\nWrite your tests for Node:\n\n```js\nvar proxyquire = require('proxyquire');\nproxyquire('./a', stubs);\n```\n\nThen add the `'proxyquire-universal'` plugin when you build your test bundle for the browser:\n\n```js\nbrowserify()\n  .plugin('proxyquire-universal')\n  .bundle()\n  .pipe(fs.createWriteStream('test-bundle.js'));\n```\n\nproxyquire-universal takes care of calling `bundle.plugin(proxyquireify.plugin)` automatically. You should not register proxyquireify manually.\n\n## Unsupported Proxyquire Features\n\nproxyquireify has a very similar API to proxyquire and will be a perfect drop-in replacement for most use cases. However, there are certain proxyquire features that are not available in proxyquireify:\n\n* [Globally overriding `require`](https://github.com/thlorenz/proxyquire#globally-override-require)\n* [Disabling the `require` cache](https://github.com/thlorenz/proxyquire#forcing-proxyquire-to-reload-modules)\n\nIf you discover a case where proxyquire and proxyquireify behave differently, please [open an issue](https://github.com/bendrucker/proxyquire-universal/issues/new) with relevant code.\n\n## License\n\nMIT © [Ben Drucker](http://bendrucker.me)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Fproxyquire-universal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendrucker%2Fproxyquire-universal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Fproxyquire-universal/lists"}