{"_id":"workman","_rev":"4-6ecdb613bf9b6f9e9ae5c938ec1b3125","name":"workman","description":"A simple command handler","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"workman","version":"0.0.1","description":"A simple command handler","main":"./lib/index.js","scripts":{"test":"mocha --recursive --colors ./tests/"},"repository":{"type":"git","url":"https://github.com/abdula/workman"},"devDependencies":{"mocha":"~1.18.2","should":"~3.3.1"},"keywords":["command","hook","action","invoker","aop","decoupled"],"author":{"name":"Ivan Maksymenko ivanmaximenko@gmail.com"},"bugs":{"url":"https://github.com/abdula/workman/issues"},"homepage":"https://github.com/abdula/workman","dependencies":{},"_id":"workman@0.0.1","dist":{"shasum":"175afb5d19d2039b880f494b2dd53fbbea38bb3f","tarball":"https://registry.npmjs.org/workman/-/workman-0.0.1.tgz","integrity":"sha512-W7HvLCXn32ukU2pdp2lSpyXKjzqxspktyguJBRZr/qYcODi29dGKJgnNE0RIWp1F/vxSc5RadBgmx2+UkBs+Rg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDs0NQlQvSR8QDRrP5UZPHF/2guuCrPpZz+0+rZmRCW3AIhAKRmjDNa4yNOGCmrWjYbatLZHXnQCJ3t788yEp3oka1a"}]},"_from":".","_npmVersion":"1.3.23","_npmUser":{"name":"ivan_maksymenko","email":"ivanmaximenko@gmail.com"},"maintainers":[{"name":"ivan_maksymenko","email":"ivanmaximenko@gmail.com"}]}},"readme":"workman\n============\n\n## Installation\n    npm install workman \n    \n## Example\n```javascript\nvar workman = require('workman'),\n    fs = require('fs');\n\nworkman.define('fs.readFile', function(file, cb) {\n    fs.readFile(file, 'utf8', cb);\n});\n\nworkman.before('fs.readFile', function(file, cb) {\n    fs.exists(file, function(exists) {\n        if (!exists) {\n            return cb(new Error('File does not exist'));\n        }\n        cb(null, file);\n    });\n});\n\nworkman.after('fs.readFile', function(content, cb) {\n    console.log('After', content);\n    cb(null, content);\n});\n\nworkman.ns('fs').wrap('readFile', (function() {\n    var cache = {};\n    return function(file, fn, cb) {\n        if (cache.hasOwnProperty(file)) {\n            return cb(null, cache[file]);\n        }\n        fn(file, function(err, content) {\n            if (err) return cb(err);\n            cache[file] = content;\n            return cb(null, content);\n        });\n    };\n}()));\n\nworkman.ns('fs').do('readFile', __dirname + '/README.md', function(err, content) {\n    console.log(content);\n}); //or invoke\n```","maintainers":[{"name":"ivan_maksymenko","email":"ivanmaximenko@gmail.com"}],"time":{"modified":"2022-06-29T03:23:51.763Z","created":"2014-08-06T12:04:57.084Z","0.0.1":"2014-08-06T12:04:57.084Z"},"homepage":"https://github.com/abdula/workman","keywords":["command","hook","action","invoker","aop","decoupled"],"repository":{"type":"git","url":"https://github.com/abdula/workman"},"author":{"name":"Ivan Maksymenko ivanmaximenko@gmail.com"},"bugs":{"url":"https://github.com/abdula/workman/issues"},"readmeFilename":"README.md"}