{"_id":"muk","_rev":"1259014","name":"muk","description":"Mock object methods and dependencies.","dist-tags":{"latest":"0.5.3"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"time":{"modified":"2021-10-15T06:41:58.000Z","created":"2012-10-30T09:45:05.055Z","0.5.3":"2016-12-05T03:29:26.183Z","0.5.2":"2016-06-12T21:47:22.552Z","0.5.1":"2016-06-12T14:28:15.407Z","0.5.0":"2016-06-11T15:56:45.311Z","0.4.0":"2015-09-17T15:13:29.985Z","0.3.2":"2014-12-28T06:42:42.346Z","0.3.1":"2013-07-04T00:19:21.851Z","0.3.0":"2013-04-15T02:02:14.299Z","0.2.0":"2012-11-02T01:39:30.606Z","0.1.2":"2012-10-31T05:59:18.525Z","0.1.1":"2012-10-30T10:51:16.258Z","0.1.0":"2012-10-30T09:45:05.055Z"},"users":{"afc163":true,"vivaxy":true,"xgheaven":true,"sinchang":true},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"versions":{"0.5.3":{"name":"muk","description":"Mock object methods and dependencies.","keywords":["test","mock","dependency"],"version":"0.5.3","repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"istanbul cover node_modules/.bin/_mocha -- -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*","istanbul":"0"},"license":"MIT","files":["lib"],"gitHead":"a42827a53eace65960962b32db301bb0fcad4323","bugs":{"url":"https://github.com/fent/node-muk/issues"},"homepage":"https://github.com/fent/node-muk#readme","_id":"muk@0.5.3","_shasum":"4e61b407751b862936350cdb223509e611ed039b","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"fent","email":"roly426@gmail.com"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"4e61b407751b862936350cdb223509e611ed039b","size":3367,"noattachment":false,"key":"/muk/-/muk-0.5.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/muk/download/muk-0.5.3.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/muk-0.5.3.tgz_1480908565595_0.8482649610377848"},"publish_time":1480908566183,"_cnpm_publish_time":1480908566183,"_hasShrinkwrap":false},"0.5.2":{"name":"muk","description":"Mock object methods and dependencies.","keywords":["test","mock","dependency"],"version":"0.5.2","repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"istanbul cover node_modules/.bin/_mocha -- -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*","istanbul":"0"},"licenses":[{"type":"MIT","url":"http://github.com/fent/node-muk/raw/master/LICENSE"}],"files":["lib"],"gitHead":"302fc882fc642eb86bef8ccf6bd7051ca0ac6739","bugs":{"url":"https://github.com/fent/node-muk/issues"},"homepage":"https://github.com/fent/node-muk#readme","_id":"muk@0.5.2","_shasum":"ae3fc7f21a1c7158ecd8e57e5706f2911add8f43","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.1","_npmUser":{"name":"fent","email":"roly426@gmail.com"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"ae3fc7f21a1c7158ecd8e57e5706f2911add8f43","size":2736,"noattachment":false,"key":"/muk/-/muk-0.5.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/muk/download/muk-0.5.2.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/muk-0.5.2.tgz_1465768039560_0.647270594490692"},"publish_time":1465768042552,"_cnpm_publish_time":1465768042552,"_hasShrinkwrap":false},"0.5.1":{"name":"muk","description":"Mock object methods and dependencies.","keywords":["test","mock","dependency"],"version":"0.5.1","repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"istanbul cover node_modules/.bin/_mocha -- -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*","istanbul":"0"},"licenses":[{"type":"MIT","url":"http://github.com/fent/node-muk/raw/master/LICENSE"}],"files":["lib"],"gitHead":"2b30f5e3ea4289b7c9fc559f1d9c98d2820f4cf1","bugs":{"url":"https://github.com/fent/node-muk/issues"},"homepage":"https://github.com/fent/node-muk#readme","_id":"muk@0.5.1","_shasum":"1a2aba67abd26b097fd1c1810357220b524060f0","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.4","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"1a2aba67abd26b097fd1c1810357220b524060f0","size":3337,"noattachment":false,"key":"/muk/-/muk-0.5.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/muk/download/muk-0.5.1.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/muk-0.5.1.tgz_1465741694765_0.15292496304027736"},"publish_time":1465741695407,"_cnpm_publish_time":1465741695407,"_hasShrinkwrap":false},"0.5.0":{"name":"muk","description":"Mock object methods and dependencies.","keywords":["test","mock","dependency"],"version":"0.5.0","repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"istanbul cover node_modules/.bin/_mocha -- -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*","istanbul":"0"},"licenses":[{"type":"MIT","url":"http://github.com/fent/node-muk/raw/master/LICENSE"}],"files":["lib"],"gitHead":"6d340b3775dc17a66f3c922fb6b3d5fc94329aa6","bugs":{"url":"https://github.com/fent/node-muk/issues"},"homepage":"https://github.com/fent/node-muk#readme","_id":"muk@0.5.0","_shasum":"f8df36a8ea8150a70724bd7d9fafbaabe41be9d2","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.1","_npmUser":{"name":"fent","email":"roly426@gmail.com"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"f8df36a8ea8150a70724bd7d9fafbaabe41be9d2","size":2608,"noattachment":false,"key":"/muk/-/muk-0.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/muk/download/muk-0.5.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/muk-0.5.0.tgz_1465660602689_0.8557844797614962"},"publish_time":1465660605311,"_cnpm_publish_time":1465660605311,"_hasShrinkwrap":false},"0.4.0":{"name":"muk","description":"Mock object methods and dependencies.","keywords":["test","mock","dependency"],"version":"0.4.0","repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"istanbul cover node_modules/.bin/_mocha -- -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*","istanbul":"0"},"licenses":[{"type":"MIT","url":"http://github.com/fent/node-muk/raw/master/LICENSE"}],"files":["lib"],"gitHead":"91f179c42056402717a93f9276c71701fc518649","bugs":{"url":"https://github.com/fent/node-muk/issues"},"homepage":"https://github.com/fent/node-muk#readme","_id":"muk@0.4.0","_shasum":"95a041c179d26070133087b0ea26d3b01c6b8e7e","_from":".","_npmVersion":"2.14.3","_nodeVersion":"3.3.1","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"95a041c179d26070133087b0ea26d3b01c6b8e7e","size":3015,"noattachment":false,"key":"/muk/-/muk-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/muk/download/muk-0.4.0.tgz"},"publish_time":1442502809985,"_cnpm_publish_time":1442502809985,"_hasShrinkwrap":false},"0.3.2":{"name":"muk","description":"Mock object methods and dependencies.","keywords":["test","mock","dependency"],"version":"0.3.2","repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"mocha -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*"},"licenses":[{"type":"MIT","url":"http://github.com/fent/node-muk/raw/master/LICENSE"}],"gitHead":"a8144fa17186b1e1f23786814c983f2fe0985c0e","bugs":{"url":"https://github.com/fent/node-muk/issues"},"homepage":"https://github.com/fent/node-muk","_id":"muk@0.3.2","_shasum":"83f5242b9b7e062d2ef6d3afdb5c09ee9bcbb7bd","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"fent","email":"roly426@gmail.com"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"dist":{"shasum":"83f5242b9b7e062d2ef6d3afdb5c09ee9bcbb7bd","size":4103,"noattachment":false,"key":"/muk/-/muk-0.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/muk/download/muk-0.3.2.tgz"},"publish_time":1419748962346,"_cnpm_publish_time":1419748962346,"_hasShrinkwrap":false},"0.3.1":{"name":"muk","description":"Mock object methods and dependencies.","keywords":["test","mock","dependency"],"version":"0.3.1","repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"mocha -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*"},"licenses":[{"type":"MIT","url":"http://github.com/fent/node-muk/raw/master/LICENSE"}],"readmeFilename":"README.md","bugs":{"url":"https://github.com/fent/node-muk/issues"},"_id":"muk@0.3.1","dist":{"shasum":"9b367effee2abc9204308a5d4376c2c99fa67178","size":3998,"noattachment":false,"key":"/muk/-/muk-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/muk/download/muk-0.3.1.tgz"},"_from":".","_npmVersion":"1.3.1","_npmUser":{"name":"fent","email":"roly426@gmail.com"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"publish_time":1372897161851,"_hasShrinkwrap":false,"_cnpm_publish_time":1372897161851},"0.3.0":{"name":"muk","description":"Mock object methods and dependencies.","keywords":["test","mock","dependency"],"version":"0.3.0","repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"mocha -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*"},"licenses":[{"type":"MIT","url":"http://github.com/fent/node-muk/raw/master/LICENSE"}],"readmeFilename":"README.md","_id":"muk@0.3.0","dist":{"shasum":"b250014e89f6659db45be0856b15040df6435d3c","size":3908,"noattachment":false,"key":"/muk/-/muk-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/muk/download/muk-0.3.0.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"fent","email":"roly426@gmail.com"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"publish_time":1365991334299,"_hasShrinkwrap":false,"_cnpm_publish_time":1365991334299},"0.2.0":{"name":"muk","description":"Mock object methods and dependencies.","keywords":["test","mock","dependency"],"version":"0.2.0","repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"mocha -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*"},"licenses":[{"type":"MIT","url":"http://github.com/fent/node-muk/raw/master/LICENSE"}],"readmeFilename":"README.md","_id":"muk@0.2.0","dist":{"shasum":"1b3515c6c46a001ec24081b951cb16498bc7149c","size":3669,"noattachment":false,"key":"/muk/-/muk-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/muk/download/muk-0.2.0.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"fent","email":"roly426@gmail.com"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"publish_time":1351820370606,"_hasShrinkwrap":false,"_cnpm_publish_time":1351820370606},"0.1.2":{"name":"muk","description":"Mock object methods and dependencies.","keywords":["test","mock","dependency"],"version":"0.1.2","repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"mocha -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*"},"licenses":[{"type":"MIT","url":"http://github.com/fent/node-muk/raw/master/LICENSE"}],"readmeFilename":"README.md","_id":"muk@0.1.2","dist":{"shasum":"6bfc95a8afcac6175e62bc6d771bf874c77c3892","size":3700,"noattachment":false,"key":"/muk/-/muk-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/muk/download/muk-0.1.2.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"fent","email":"roly426@gmail.com"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"publish_time":1351663158525,"_hasShrinkwrap":false,"_cnpm_publish_time":1351663158525},"0.1.1":{"name":"muk","description":"Mock object methods and dependencies.","keywords":["test","mock","dependency"],"version":"0.1.1","repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"mocha -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*"},"licenses":[{"type":"MIT","url":"http://github.com/fent/node-muk/raw/master/LICENSE"}],"readmeFilename":"README.md","_id":"muk@0.1.1","dist":{"shasum":"af1d4545430924eadae63239c157b2fd8c6fb00e","size":2953,"noattachment":false,"key":"/muk/-/muk-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/muk/download/muk-0.1.1.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"fent","email":"roly426@gmail.com"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"publish_time":1351594276258,"_hasShrinkwrap":false,"_cnpm_publish_time":1351594276258},"0.1.0":{"name":"muk","description":"Mock object methods and dependencies.","keywords":["test","mock","dependency"],"version":"0.1.0","repository":{"type":"git","url":"git://github.com/fent/node-muk.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"mocha -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*"},"licenses":[{"type":"MIT","url":"http://github.com/fent/node-muk/raw/master/LICENSE"}],"readmeFilename":"README.md","_id":"muk@0.1.0","dist":{"shasum":"3d91320fafd3bee60ba18d1cad776309b00a54a7","size":2655,"noattachment":false,"key":"/muk/-/muk-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/muk/download/muk-0.1.0.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"fent","email":"roly426@gmail.com"},"maintainers":[{"name":"fent","email":"fentbox@gmail.com"},{"name":"popomore","email":""}],"publish_time":1351590305055,"_hasShrinkwrap":false,"_cnpm_publish_time":1351590305055}},"readme":"# muk\n\n[![Build Status](https://secure.travis-ci.org/fent/node-muk.svg)](http://travis-ci.org/fent/node-muk)\n[![Dependency Status](https://gemnasium.com/fent/node-muk.svg)](https://gemnasium.com/fent/node-muk)\n[![codecov](https://codecov.io/gh/fent/node-muk/branch/master/graph/badge.svg)](https://codecov.io/gh/fent/node-muk)\n\n![muk](muk.gif)\n\n# Usage\n\nMock dependencies.\n\n**foo.js**\n```js\nvar request = require('request');\n\nmodule.exports = function foo(url) {\n  // do something with request\n};\n```\n\n**test.js**\n```js\nvar mockedRequest = function(url, options, callback) {\n  // mock a request here\n};\n\nvar foo = muk('./foo', {\n  request: mockedRequest\n});\n```\n\nYou can also mock modules required with a relative path.\n\n**some/where/else/foo.js**\n```js\nvar bar = require('./bar');\n\nmodule.exports = function() {\n  // do something with bar\n};\n```\n\n**some/where/else/bar.js**\n```js\nexports.attack = 'sludge attack!';\n```\n\n**test.js**\n```js\nvar foo = muk('./some/where/else/foo', { './bar': 'hey!!' });\n```\n\nComes with object method mocking too.\n\n```js\nvar fs = require('fs');\nvar muk = require('muk');\n\nmuk(fs, 'readFile', function(path, callback) {\n  process.nextTick(callback.bind(null, null, 'file contents here'));\n});\n```\n\nCheck if member has been mocked.\n\n```js\nmuk.isMocked(fs, 'readFile'); // true\n```\n\nRestore all mocked methods after tests.\n\n```js\nmuk.restore();\n\nfs.readFile(file, function(err, data) {\n  // will actually read from `file`\n});\n```\n\n\n# Install\n\n    npm install muk\n\n\n# Tests\nTests are written with [mocha](http://visionmedia.github.com/mocha/)\n\n```bash\nnpm test\n```\n\n# License\nMIT\n","_attachments":{},"homepage":"https://github.com/fent/node-muk#readme","bugs":{"url":"https://github.com/fent/node-muk/issues"},"license":"MIT"}