{"id":23364401,"url":"https://github.com/nhz-io/mini-mock","last_synced_at":"2025-04-07T22:26:22.128Z","repository":{"id":57130863,"uuid":"67934465","full_name":"nhz-io/mini-mock","owner":"nhz-io","description":"Patch require to return mocks","archived":false,"fork":false,"pushed_at":"2016-09-11T16:23:51.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-02T02:19:29.869Z","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/nhz-io.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-09-11T14:31:02.000Z","updated_at":"2016-09-20T02:44:36.000Z","dependencies_parsed_at":"2022-09-01T00:12:17.159Z","dependency_job_id":null,"html_url":"https://github.com/nhz-io/mini-mock","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/nhz-io%2Fmini-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhz-io%2Fmini-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhz-io%2Fmini-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhz-io%2Fmini-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nhz-io","download_url":"https://codeload.github.com/nhz-io/mini-mock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247739402,"owners_count":20988013,"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-12-21T13:15:25.916Z","updated_at":"2025-04-07T22:26:22.089Z","avatar_url":"https://github.com/nhz-io.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e@nhz.io/mini-mock\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.org/package/@nhz.io/mini-mock\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@nhz.io/mini-mock.svg?style=flat\"\n         alt=\"NPM Version\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://www.bithound.io/github/nhz-io/mini-mock\"\u003e\n    \u003cimg src=\"https://www.bithound.io/github/nhz-io/mini-mock/badges/score.svg\"\n         alt=\"Bithound Status\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/nhz-io/mini-mock/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/nhz-io/mini-mock.svg?style=flat\"\n         alt=\"License\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://npmjs.org/package/@nhz.io/mini-mock\"\u003e\n  \u003cimg src=\"http://img.shields.io/npm/dm/@nhz.io/mini-mock.svg?style=flat\"\n  alt=\"Downloads\"\u003e\n  \u003c/a\u003e  \n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003ePatch `require()` to return mocks\u003ch2\u003e\n\n## Install\n```\nnpm i -D @nhz.io/mini-mock\n```\n\n## Usage\n```javascript\n// will-get-mock.js\nconst someModule = require('some-module')\n...\n```\n\n```javascript\n// will-get-real.js\nconst someModule = require('some-module')\n...\n```\n\n```javascript\n// test.js\nrequire('@nhz.io/mini-mock')\n\nmodule.mock('some-module', 'Mocked value')\nrequire('./will-get-mock.js')\n\nmodule.unmock('some-module')\nrequire('./will-get-real.js')\n...\n```\n\n## License\n\n### [MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhz-io%2Fmini-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnhz-io%2Fmini-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhz-io%2Fmini-mock/lists"}