{"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","tarball":"http://registry-npm.ywwl.com/stubs/download/stubs-2.0.0.tgz","integrity":"sha512-bh9uXBBwzeQaAhzor/TpvaOEM3yOiyXwln0jFilXFFlWH6SbCiw3zhTWJT8rUWzny2ZH9Xhl0hHGUUkCHNkTKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcoUFKJpjKtMfvpar4GFJyc1Jc0OYpenZ51FNzJnb2rwIhAJCKh8EOgfPMDneWqE+yJ+R0gVqVm7/a37ff+8rvt47g"}],"size":1814,"noattachment":false,"key":"/stubs/-/stubs-2.0.0.tgz"},"maintainers":[{"name":"stephenplusplus","email":"sawchuk@gmail.com"}],"directories":{},"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.","publish_time":1436299913795,"_cnpm_publish_time":1436299913795,"dist-tags":{"latest":"3.0.0"}}