{"id":28575178,"url":"https://github.com/unjs/mocked-exports","last_synced_at":"2025-06-10T22:41:57.551Z","repository":{"id":281372503,"uuid":"945106783","full_name":"unjs/mocked-exports","owner":"unjs","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-16T02:59:49.000Z","size":64,"stargazers_count":11,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-22T06:45:47.765Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/unjs.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":"2025-03-08T17:14:06.000Z","updated_at":"2025-04-04T04:46:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"dd1ab33c-f6a8-43bc-b359-7c569cae39fb","html_url":"https://github.com/unjs/mocked-exports","commit_stats":null,"previous_names":["unjs/mocked-exports"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fmocked-exports","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fmocked-exports/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fmocked-exports/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fmocked-exports/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unjs","download_url":"https://codeload.github.com/unjs/mocked-exports/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fmocked-exports/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259165995,"owners_count":22815544,"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":"2025-06-10T22:41:49.179Z","updated_at":"2025-06-10T22:41:57.542Z","avatar_url":"https://github.com/unjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mocked-exports\n\n\u003c!-- automd:badges codecov color=yellow --\u003e\n\n[![npm version](https://img.shields.io/npm/v/mocked-exports?color=yellow)](https://npmjs.com/package/mocked-exports)\n[![npm downloads](https://img.shields.io/npm/dm/mocked-exports?color=yellow)](https://npm.chart.dev/mocked-exports)\n[![codecov](https://img.shields.io/codecov/c/gh/unjs/mocked-exports?color=yellow)](https://codecov.io/gh/unjs/mocked-exports)\n\n\u003c!-- /automd --\u003e\n\nSimple mocks (extracted from [unjs/unenv](https://github.com/unjs/unenv.git)).\n\nMain usage of `mocked-exports` is to use them as **bundler aliases** to mock specific modules you don't want to end-up into your bundle.\n\n```js\n// Exports a dynamic mock proxy function\nconst proxy = require(\"mocked-exports/proxy\");\nimport proxy from \"mocked-exports/proxy\";\nimport proxy from \"mocked-exports/proxy/foo/bar/baz\";\n\n// Exports a no-op frozen function\nconst noop = require(\"mocked-exports/noop\");\nimport noop from \"mocked-exports/noop\";\n\n// Exports an empty frozen object\nconst empty = require(\"mocked-exports/empty\");\nimport empty from \"mocked-exports/empty\";\n```\n\nThere are also extra variants of exports with `-mjs` or `-cjs` suffixes available if your mocking needs to force a specific format.\n\n## Magic proxy\n\nThe `proxy` mock, is a nested deep proxy that tries to replace any dynamic nested access to an unknown object.\n\nExamples: `proxy.foo.bar().xyz[1].then(() =\u003e {});`\n\nFor better debugging, you can use `proxy.__mock__('name')` to create a named instance.\n\n## Development\n\n\u003cdetails\u003e\n\n\u003csummary\u003elocal development\u003c/summary\u003e\n\n- Clone this repository\n- Install latest LTS version of [Node.js](https://nodejs.org/en/)\n- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`\n- Install dependencies using `pnpm install`\n- Run interactive tests using `pnpm dev`\n\n\u003c/details\u003e\n\n## License\n\n\u003c!-- automd:contributors license=MIT --\u003e\n\nPublished under the [MIT](https://github.com/unjs/mocked-exports/blob/main/LICENSE) license.\nMade by [community](https://github.com/unjs/mocked-exports/graphs/contributors) 💛\n\u003cbr\u003e\u003cbr\u003e\n\u003ca href=\"https://github.com/unjs/mocked-exports/graphs/contributors\"\u003e\n\u003cimg src=\"https://contrib.rocks/image?repo=unjs/mocked-exports\" /\u003e\n\u003c/a\u003e\n\n\u003c!-- /automd --\u003e\n\n\u003c!-- automd:with-automd --\u003e\n\n---\n\n_🤖 auto updated with [automd](https://automd.unjs.io)_\n\n\u003c!-- /automd --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funjs%2Fmocked-exports","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funjs%2Fmocked-exports","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funjs%2Fmocked-exports/lists"}