{"_id":"stubs","_rev":"212544","name":"stubs","description":"Easy method stubber.","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"stephenplusplus","email":""}],"time":{"modified":"2021-06-03T15:31:20.000Z","created":"2014-10-16T22:48:46.172Z","3.0.0":"2017-01-13T15:12:29.416Z","2.0.0":"2015-07-07T20:11:53.795Z","1.1.2":"2014-10-17T04:03:02.369Z","1.1.1":"2014-10-17T02:41:30.271Z","1.1.0":"2014-10-16T23:17:25.506Z","1.0.0":"2014-10-16T22:48:46.172Z"},"users":{},"author":{"name":"Stephen Sawchuk"},"repository":{"type":"git","url":"git+https://github.com/stephenplusplus/stubs.git"},"versions":{"3.0.0":{"name":"stubs","version":"3.0.0","description":"Easy method stubber.","main":"index.js","scripts":{"test":"node ./test"},"repository":{"type":"git","url":"git+https://github.com/stephenplusplus/stubs.git"},"keywords":["stubs"],"author":{"name":"Stephen Sawchuk"},"license":"MIT","bugs":{"url":"https://github.com/stephenplusplus/stubs/issues"},"homepage":"https://github.com/stephenplusplus/stubs","devDependencies":{"tess":"^1.0.0"},"gitHead":"2d41d3ae487d3bb0b8c7511d254783eaad862d8f","_id":"stubs@3.0.0","_shasum":"e8d2ba1fa9c90570303c030b6900f7d5f89abe5b","_from":".","_npmVersion":"4.0.5","_nodeVersion":"6.9.1","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"dist":{"shasum":"e8d2ba1fa9c90570303c030b6900f7d5f89abe5b","size":1953,"noattachment":false,"key":"/stubs/-/stubs-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stubs/download/stubs-3.0.0.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/stubs-3.0.0.tgz_1484320348722_0.21513390797190368"},"directories":{},"publish_time":1484320349416,"_cnpm_publish_time":1484320349416,"_hasShrinkwrap":false},"2.0.0":{"name":"stubs","version":"2.0.0","description":"Easy method stubber.","main":"index.js","scripts":{"test":"node ./test"},"repository":{"type":"git","url":"git+https://github.com/stephenplusplus/stubs.git"},"keywords":["stubs"],"author":{"name":"Stephen Sawchuk"},"license":"MIT","bugs":{"url":"https://github.com/stephenplusplus/stubs/issues"},"homepage":"https://github.com/stephenplusplus/stubs","devDependencies":{"tess":"^1.0.0"},"gitHead":"a6d0e86b9957ae1530d7b5c6e2594e0b8f972699","_id":"stubs@2.0.0","_shasum":"586df53856d626684df1656faf8a392ee389ac4c","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"dist":{"shasum":"586df53856d626684df1656faf8a392ee389ac4c","size":1814,"noattachment":false,"key":"/stubs/-/stubs-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stubs/download/stubs-2.0.0.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"directories":{},"publish_time":1436299913795,"_cnpm_publish_time":1436299913795,"_hasShrinkwrap":false},"1.1.2":{"name":"stubs","version":"1.1.2","description":"Easy method stubber.","main":"index.js","scripts":{"test":"node ./test"},"repository":{"type":"git","url":"https://github.com/stephenplusplus/stubs"},"keywords":["stubs"],"author":{"name":"Stephen Sawchuk"},"license":"MIT","bugs":{"url":"https://github.com/stephenplusplus/stubs/issues"},"homepage":"https://github.com/stephenplusplus/stubs","gitHead":"10cb1930f22fec1c7b1bff05318fbe658bedf15e","_id":"stubs@1.1.2","_shasum":"945a08975016318762f8f7060731002ab2a0960c","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.10.32","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"maintainers":[{"name":"stephenplusplus","email":""}],"dist":{"shasum":"945a08975016318762f8f7060731002ab2a0960c","size":1992,"noattachment":false,"key":"/stubs/-/stubs-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/stubs/download/stubs-1.1.2.tgz"},"directories":{},"publish_time":1413518582369,"_cnpm_publish_time":1413518582369,"_hasShrinkwrap":false},"1.1.1":{"name":"stubs","version":"1.1.1","description":"Easy method stubber.","main":"index.js","scripts":{"test":"node ./test"},"repository":{"type":"git","url":"https://github.com/stephenplusplus/stubs"},"keywords":["stubs"],"author":{"name":"Stephen Sawchuk"},"license":"MIT","bugs":{"url":"https://github.com/stephenplusplus/stubs/issues"},"homepage":"https://github.com/stephenplusplus/stubs","gitHead":"f737049e2728137de3390c0c9004d333ce844aea","_id":"stubs@1.1.1","_shasum":"51720087513706b3988c4db54226ad4107ffcef6","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.10.32","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"maintainers":[{"name":"stephenplusplus","email":""}],"dist":{"shasum":"51720087513706b3988c4db54226ad4107ffcef6","size":1998,"noattachment":false,"key":"/stubs/-/stubs-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stubs/download/stubs-1.1.1.tgz"},"directories":{},"publish_time":1413513690271,"_cnpm_publish_time":1413513690271,"_hasShrinkwrap":false},"1.1.0":{"name":"stubs","version":"1.1.0","description":"Easy method stubber.","main":"index.js","scripts":{"test":"node ./test"},"repository":{"type":"git","url":"https://github.com/stephenplusplus/stubs"},"keywords":["stubs"],"author":{"name":"Stephen Sawchuk"},"license":"MIT","bugs":{"url":"https://github.com/stephenplusplus/stubs/issues"},"homepage":"https://github.com/stephenplusplus/stubs","gitHead":"bfb6c8e7a206277467ca9a87168755470c1fe592","_id":"stubs@1.1.0","_shasum":"c2dce2e3bebe2bf4d257d358a049d670fe168951","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.10.32","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"maintainers":[{"name":"stephenplusplus","email":""}],"dist":{"shasum":"c2dce2e3bebe2bf4d257d358a049d670fe168951","size":1959,"noattachment":false,"key":"/stubs/-/stubs-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stubs/download/stubs-1.1.0.tgz"},"directories":{},"publish_time":1413501445506,"_cnpm_publish_time":1413501445506,"_hasShrinkwrap":false},"1.0.0":{"name":"stubs","version":"1.0.0","description":"Easy method stubber.","main":"index.js","scripts":{"test":"node ./test"},"repository":{"type":"git","url":"https://github.com/stephenplusplus/stubs"},"keywords":["stubs"],"author":{"name":"Stephen Sawchuk"},"license":"MIT","bugs":{"url":"https://github.com/stephenplusplus/stubs/issues"},"homepage":"https://github.com/stephenplusplus/stubs","gitHead":"c1c0e686d9681a13dccafd1f63084ef0185e59d0","_id":"stubs@1.0.0","_shasum":"edf81103ab1818f7248fa546d1193e5e03db920f","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.10.32","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"maintainers":[{"name":"stephenplusplus","email":""}],"dist":{"shasum":"edf81103ab1818f7248fa546d1193e5e03db920f","size":1716,"noattachment":false,"key":"/stubs/-/stubs-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stubs/download/stubs-1.0.0.tgz"},"directories":{},"publish_time":1413499726172,"_cnpm_publish_time":1413499726172,"_hasShrinkwrap":false}},"readme":"# stubs\n\n> It's a simple stubber.\n\n## About\n\nFor when you don't want to write the same thing over and over to cache a method and call an override, then revert it, and blah blah.\n\n\n## Use\n```sh\n$ npm install --save-dev stubs\n```\n```js\nvar mylib = require('./lib/index.js')\nvar stubs = require('stubs')\n\n// make it a noop\nstubs(mylib, 'create')\n\n// stub it out\nstubs(mylib, 'create', function() {\n  // calls this instead\n})\n\n// stub it out, but call the original first\nstubs(mylib, 'create', { callthrough: true }, function() {\n  // call original method, then call this\n})\n\n// use the stub for a while, then revert\nstubs(mylib, 'create', { calls: 3 }, function() {\n  // call this 3 times, then use the original method\n})\n```\n\n\n## API\n\n### stubs(object, method[[, opts], stub])\n\n#### object\n- Type: Object\n\n#### method\n- Type: String\n\nName of the method to stub.\n\n#### opts\n- (optional)\n- Type: Object\n\n##### opts.callthrough\n- (optional)\n- Type: Boolean\n- Default: `false`\n\nCall the original method as well as the stub (if a stub is provided).\n\n##### opts.calls\n- (optional)\n- Type: Number\n- Default: `0` (never revert)\n\nNumber of calls to allow the stub to receive until reverting to the original.\n\n#### stub\n- (optional)\n- Type: Function\n- Default: `function() {}`\n\nThis method is called in place of the original method. If `opts.callthrough` is `true`, this method is called *after* the original method is called as well.","_attachments":{},"homepage":"https://github.com/stephenplusplus/stubs","bugs":{"url":"https://github.com/stephenplusplus/stubs/issues"},"license":"MIT"}