{"_id":"before","_rev":"5-670fd7448393bf742f81a77ec8522e7b","name":"before","description":"before decorator factory","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"before","version":"0.0.1","repository":{"type":"git","url":"https://github.com/stagas/before"},"description":"before decorator factory","keywords":["before","pre","hook"],"author":{"name":"stagas","email":"gstagas@gmail.com"},"license":"MIT","main":"index.js","dependencies":{},"devDependencies":{"should":"~2.1.0"},"engines":{"node":"*"},"readme":"\n# before\n\nbefore decorator factory\n\n## Installation\n\n`npm install before`\n\n## Example\n\n```js\nvar before = require('before');\n\n// an object with some method\nvar speak = {\n  greeting: 'welcome',\n  greet: function(a, b, fn){\n    fn(null, a + ' ' + b);\n  }\n};\n\n// factory before hook method\nspeak.before = before(speak);\n\n// before greet\nspeak.before('greet', function(args, fn){\n  args[0] = args[0] + ' to this wonderful';\n  fn();\n});\n\n// one more, this will run first\nspeak.before('greet', function(args, fn){\n  args[0] = args[0] + ', ' + this.greeting;\n  fn();\n});\n\n// runs mutation hooks, then greets\nspeak.greet('Human', 'world!', function(err, result){\n  console.log(result); // => Human, welcome to this wonderful world!\n});\n```\n\n## API\n\n### before(context)\n\nCaptures `context` to be used by decorator.\n\n### before(method, outer)\n\nDecorates `method` using `outer`.\n\n`outer` is called with `(args, fn)` to allow\narguments mutation.\n\n## License\n\nMIT\n","readmeFilename":"Readme.md","bugs":{"url":"https://github.com/stagas/before/issues"},"_id":"before@0.0.1","dist":{"shasum":"d21270e98747e9097253441e868adb325ae72dda","tarball":"https://registry.npmjs.org/before/-/before-0.0.1.tgz","integrity":"sha512-1J5SWbkoVJH9DTALN8igB4p+nPKZzPrJ/HomqBDLpfUvDXCdjdBmBUcH5McZfur0lftVssVU6BZug5NYh87zTw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFuIctaQBwOqh0jYdtToVagjeCaJGJzJt2CSaL61riPFAiEAmjnYoV2vxgWFMDkQClRQwRxrCmZUmGI8iMvB0SaHiYc="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"stagas","email":"gstagas@gmail.com"},"maintainers":[{"name":"stagas","email":"gstagas@gmail.com"}]}},"readme":"\n# before\n\nbefore decorator factory\n\n## Installation\n\n`npm install before`\n\n## Example\n\n```js\nvar before = require('before');\n\n// an object with some method\nvar speak = {\n  greeting: 'welcome',\n  greet: function(a, b, fn){\n    fn(null, a + ' ' + b);\n  }\n};\n\n// factory before hook method\nspeak.before = before(speak);\n\n// before greet\nspeak.before('greet', function(args, fn){\n  args[0] = args[0] + ' to this wonderful';\n  fn();\n});\n\n// one more, this will run first\nspeak.before('greet', function(args, fn){\n  args[0] = args[0] + ', ' + this.greeting;\n  fn();\n});\n\n// runs mutation hooks, then greets\nspeak.greet('Human', 'world!', function(err, result){\n  console.log(result); // => Human, welcome to this wonderful world!\n});\n```\n\n## API\n\n### before(context)\n\nCaptures `context` to be used by decorator.\n\n### before(method, outer)\n\nDecorates `method` using `outer`.\n\n`outer` is called with `(args, fn)` to allow\narguments mutation.\n\n## License\n\nMIT\n","maintainers":[{"name":"stagas","email":"gstagas@gmail.com"}],"time":{"modified":"2022-06-13T04:29:45.951Z","created":"2013-11-21T22:02:28.169Z","0.0.1":"2013-11-21T22:02:30.894Z"},"author":{"name":"stagas","email":"gstagas@gmail.com"},"repository":{"type":"git","url":"https://github.com/stagas/before"}}