{"id":16528377,"url":"https://github.com/danvk/stub-require","last_synced_at":"2025-07-11T04:40:12.043Z","repository":{"id":22500713,"uuid":"25840287","full_name":"danvk/stub-require","owner":"danvk","description":"Automatically create stubbed-out versions of node.js modules, ala Jest's autoMock","archived":false,"fork":false,"pushed_at":"2014-10-28T03:14:48.000Z","size":152,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T10:03:44.206Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danvk.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-27T21:34:51.000Z","updated_at":"2015-08-07T10:59:01.000Z","dependencies_parsed_at":"2022-08-20T18:20:15.143Z","dependency_job_id":null,"html_url":"https://github.com/danvk/stub-require","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/danvk%2Fstub-require","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danvk%2Fstub-require/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danvk%2Fstub-require/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danvk%2Fstub-require/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danvk","download_url":"https://codeload.github.com/danvk/stub-require/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241618033,"owners_count":19991790,"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-11T17:40:08.367Z","updated_at":"2025-03-03T06:24:06.167Z","avatar_url":"https://github.com/danvk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"stub-require\n===========\n\nAutomatically create stubbed-out versions of node.js modules, ala Jest's autoMock.\n\nUsage:\n\n```javascript\n// BigComplexModule.js\nmodule.exports = {\n  foo: function() { return 42; }\n};\n```\n\n```javascript\n// foo.js\nmodule.exports = function() {\n  return require('./BigComplexModule').foo();\n};\n```\n\n```javascript\n// foo-test.js\nvar stubRequire = require('stubrequire')(['BigComplexModule']),\n    foo = stubRequire('./foo');\n\nfoo();  // returns undefined, not 42.\n```\n\nstubrequire will mock out both methods and classes, i.e. if a module exports\n`module.foo`, then `new module.foo()` will return an object with the same\nmethods as the original, but all stubbed out.\n\nInstallation\n\n```\nnpm install --save-dev stub-require\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanvk%2Fstub-require","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanvk%2Fstub-require","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanvk%2Fstub-require/lists"}