{"_id":"@flexshopper/hapi-pres","_rev":"26-9dc6a77db093339271dea31795b10546","name":"@flexshopper/hapi-pres","dist-tags":{"latest":"3.1.0"},"versions":{"1.0.0":{"name":"@flexshopper/hapi-pres","version":"1.0.0","keywords":[],"author":{"name":"Angel Ramirez","email":"angel.ramirez@flexshopper.com"},"license":"ISC","_id":"@flexshopper/hapi-pres@1.0.0","maintainers":[{"name":"ar4mirez","email":"angel@cuemby.com"}],"homepage":"https://github.com/FlexShopper/hapi-pres#readme","bugs":{"url":"https://github.com/FlexShopper/hapi-pres/issues"},"dist":{"shasum":"78e7e82232f5e5ea5a5ca2ce9f2f7e1ae422b513","tarball":"https://registry.npmjs.org/@flexshopper/hapi-pres/-/hapi-pres-1.0.0.tgz","integrity":"sha512-BH6FMNZSzpqQ7BCdfEukzzD7F3xyNvHNP8FL+kpRIyCXoJquhs1cgaGyTSe27/vE203cIWnqJbPaINjgQaGFrA==","signatures":[{"sig":"MEUCIF40h5lN6og5EFPgeBOXoIa8Dwuig+1xGYuwVxrj6R9HAiEA7B0MjKQeGOobyfks3EcluUwhiN5LWkmNm+JcvO48aJw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"78e7e82232f5e5ea5a5ca2ce9f2f7e1ae422b513","gitHead":"1ad41ed8a7f733b85e663c891d3c5c352113cfc5","scripts":{"fix":"node_modules/fixpack/bin/fixpack","test":"node_modules/lab/bin/lab -t 100 -C -S -v -a code && gulp eslint","standards":"gulp"},"_npmUser":{"name":"ar4mirez","email":"angel@cuemby.com"},"repository":{"url":"git+https://github.com/FlexShopper/hapi-pres.git","type":"git"},"_npmVersion":"3.8.1","description":"Hapi plugin to autoload pres.","directories":{},"_nodeVersion":"5.0.0","dependencies":{"joi":"^8.0.4","glob":"^7.0.3","hoek":"^3.0.4","cast-array":"^1.0.1"},"devDependencies":{"lab":"^8.2.0","code":"^2.1.0","gulp":"^3.9.1","hapi":"^13.0.0","eslint":"^1.10.3","fixpack":"^2.3.0","gulp-eslint":"^1.1.1","gulp-notify":"^2.2.0","eslint-config-yandex":"^1.0.5","eslint-config-flexshopper":"github:flexshopper/eslint-config"},"_npmOperationalInternal":{"tmp":"tmp/hapi-pres-1.0.0.tgz_1457992551689_0.4627571541350335","host":"packages-13-west.internal.npmjs.com"}},"1.0.3":{"name":"@flexshopper/hapi-pres","version":"1.0.3","keywords":[],"author":{"name":"Angel Ramirez","email":"angel.ramirez@flexshopper.com"},"license":"ISC","_id":"@flexshopper/hapi-pres@1.0.3","maintainers":[{"name":"ar4mirez","email":"angel@cuemby.com"},{"name":"charlle","email":"charleston.malkemus@flexshopper.com"},{"name":"gills","email":"john.gills@flexshopper.com"},{"name":"mrferos","email":"me@andresgalindo.us"},{"name":"onel0p3z","email":"onel0p3z@gmail.com"},{"name":"travis-fs","email":"development@flexshopper.com"}],"homepage":"https://github.com/FlexShopper/hapi-pres#readme","bugs":{"url":"https://github.com/FlexShopper/hapi-pres/issues"},"dist":{"shasum":"7a289540535a4aed4bd4fc5db330dcbf9abe5b32","tarball":"https://registry.npmjs.org/@flexshopper/hapi-pres/-/hapi-pres-1.0.3.tgz","integrity":"sha512-ZJciUf+OiVSTM40CpIrbOlP19EIaiJlHTbA7M4kOdPyLBzUAJJV2aimodrkSh4YwrbB15geJftf0vXN6JxXyAg==","signatures":[{"sig":"MEYCIQD4bTR+90i/DcOkdJNXIH+yqifLIRzU+2RB/oQhSr9+nwIhAIbF/Yrrn+L6MRIth0hXySlzycBthwrIbeLcHpJJg52v","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"7a289540535a4aed4bd4fc5db330dcbf9abe5b32","gitHead":"e60ee7fe749ad20e2d2f6a194a09e021a747a255","scripts":{"fix":"node_modules/fixpack/bin/fixpack","test":"node_modules/lab/bin/lab -t 100 -C -S -v -a code && gulp eslint","standards":"gulp"},"_npmUser":{"name":"ar4mirez","email":"angel@cuemby.com"},"repository":{"url":"git+https://github.com/FlexShopper/hapi-pres.git","type":"git"},"_npmVersion":"3.8.1","description":"Hapi plugin to autoload pres.","directories":{},"_nodeVersion":"5.0.0","dependencies":{"joi":"^8.0.4","glob":"^7.0.3","hoek":"^3.0.4","cast-array":"^1.0.1"},"devDependencies":{"lab":"^8.2.0","code":"^2.1.0","gulp":"^3.9.1","hapi":"^13.0.0","eslint":"^2.4.0","fixpack":"^2.3.0","gulp-eslint":"^1.1.1","gulp-notify":"^2.2.0","estraverse-fb":"^1.3.1","eslint-config-yandex":"^1.0.6","eslint-config-flexshopper":"github:flexshopper/eslint-config"},"_npmOperationalInternal":{"tmp":"tmp/hapi-pres-1.0.3.tgz_1458073246265_0.4616296694148332","host":"packages-12-west.internal.npmjs.com"}},"1.0.4":{"name":"@flexshopper/hapi-pres","version":"1.0.4","keywords":[],"author":{"name":"Angel Ramirez","email":"angel.ramirez@flexshopper.com"},"license":"ISC","_id":"@flexshopper/hapi-pres@1.0.4","maintainers":[{"name":"ar4mirez","email":"angel@cuemby.com"},{"name":"charlle","email":"charleston.malkemus@flexshopper.com"},{"name":"gills","email":"john.gills@flexshopper.com"},{"name":"mrferos","email":"me@andresgalindo.us"},{"name":"onel0p3z","email":"onel0p3z@gmail.com"},{"name":"travis-fs","email":"development@flexshopper.com"}],"homepage":"https://github.com/FlexShopper/hapi-pres#readme","bugs":{"url":"https://github.com/FlexShopper/hapi-pres/issues"},"dist":{"shasum":"44de2a6758947f99475260c3513ed677cb5b759c","tarball":"https://registry.npmjs.org/@flexshopper/hapi-pres/-/hapi-pres-1.0.4.tgz","integrity":"sha512-K5WuBSIYv9vSSzG/3kHM/knnmSU9JwMY+8fC7+M1+3Gl5Io+d9++wNOa5LyRRFcVmXojleCWIdTu86em0cqZ+Q==","signatures":[{"sig":"MEUCIAcVDgHBfSmYjOGOAMA4CsRvNZhjss8WlTHsLOB4peySAiEAzs2IFepLMQ6W3iKbzyiX6xWc7F7f6YGtEHUYl1huyMo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"44de2a6758947f99475260c3513ed677cb5b759c","gitHead":"082ea3cf41a8bd692e6b94001b5559105d793fda","scripts":{"fix":"node_modules/fixpack/bin/fixpack","test":"node_modules/lab/bin/lab -t 100 -C -S -v -a code && gulp eslint","standards":"gulp"},"_npmUser":{"name":"ar4mirez","email":"angel@cuemby.com"},"repository":{"url":"git+https://github.com/FlexShopper/hapi-pres.git","type":"git"},"_npmVersion":"3.8.1","description":"Hapi plugin to autoload pres.","directories":{},"_nodeVersion":"5.0.0","dependencies":{"joi":"^8.0.4","glob":"^7.0.3","hoek":"^3.0.4","cast-array":"^1.0.1"},"devDependencies":{"lab":"^8.2.0","code":"^2.1.0","gulp":"^3.9.1","hapi":"^13.0.0","eslint":"^2.4.0","fixpack":"^2.3.0","gulp-eslint":"^1.1.1","gulp-notify":"^2.2.0","estraverse-fb":"^1.3.1","eslint-config-yandex":"^1.0.6","eslint-config-flexshopper":"github:flexshopper/eslint-config"},"_npmOperationalInternal":{"tmp":"tmp/hapi-pres-1.0.4.tgz_1458159029192_0.4273724867962301","host":"packages-13-west.internal.npmjs.com"}},"2.0.0":{"name":"@flexshopper/hapi-pres","version":"2.0.0","keywords":[],"author":{"name":"Angel Ramirez","email":"angel.ramirez@flexshopper.com"},"license":"ISC","_id":"@flexshopper/hapi-pres@2.0.0","maintainers":[{"name":"ar4mirez","email":"angel@cuemby.com"},{"name":"charlle","email":"charleston.malkemus@flexshopper.com"},{"name":"gills","email":"john.gills@flexshopper.com"},{"name":"mrferos","email":"me@andresgalindo.us"},{"name":"onel0p3z","email":"onel0p3z@gmail.com"},{"name":"travis-fs","email":"development@flexshopper.com"}],"homepage":"https://github.com/FlexShopper/hapi-pres#readme","bugs":{"url":"https://github.com/FlexShopper/hapi-pres/issues"},"dist":{"shasum":"1745602af4c72fb28aeb8cea04fb4e49e1d60f73","tarball":"https://registry.npmjs.org/@flexshopper/hapi-pres/-/hapi-pres-2.0.0.tgz","integrity":"sha512-rJJtnwYNCG5cSow/QKMTUHj8RcNosA6SFXBcGBO3zaB3yPcPce/F9OeXYF+8HQWH7tlVBpR0k5bKWz/Cc3JLUg==","signatures":[{"sig":"MEQCIB8tq+POuRvX9J+HMK/OVKlKIAk7vwVyuDd7tkMMOWB/AiBv+EwxPBYuUVxud4HyEAFXVy78HFYgClrvCaK5UUyxSw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"1745602af4c72fb28aeb8cea04fb4e49e1d60f73","gitHead":"4c3203f84dc9589a3503fe0e8cfcc3cfa7fc08ae","scripts":{"dev":"nodemon lib/index.js -i logs","fix":"fixpack","test":"lab -t 100 -C -S -v -a code && npm run standards","standards":"gulp eslint","test-cov-html":"lab -r html -o coverage/coverage.html"},"_npmUser":{"name":"ar4mirez","email":"angel@cuemby.com"},"repository":{"url":"git+https://github.com/FlexShopper/hapi-pres.git","type":"git"},"_npmVersion":"3.8.6","description":"Hapi plugin to autoload pres.","directories":{},"_nodeVersion":"6.1.0","dependencies":{"joi":"^8.4.2","glob":"^7.0.3","hoek":"^4.0.1","async":"^2.0.0-rc.6"},"devDependencies":{"lab":"^10.5.1","code":"^2.3.0","gulp":"^3.9.1","hapi":"^13.4.0","eslint":"^2.10.2","fixpack":"^2.3.1","nodemon":"^1.9.2","gulp-eslint":"^2.0.0","estraverse-fb":"^1.3.1","eslint-config-yandex":"^1.0.6","@flexshopper/eslint-config-flexshopper":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/hapi-pres-2.0.0.tgz_1466444939856_0.6061436727177352","host":"packages-12-west.internal.npmjs.com"}},"3.0.0":{"name":"@flexshopper/hapi-pres","version":"3.0.0","keywords":["hapi","plugin"],"author":{"name":"Angel Ramirez","email":"angel.ramirez@flexshopper.com"},"license":"ISC","_id":"@flexshopper/hapi-pres@3.0.0","maintainers":[{"name":"ar4mirez","email":"angel@cuemby.com"},{"name":"charlle","email":"charleston.malkemus@flexshopper.com"},{"name":"gills","email":"john.gills@flexshopper.com"},{"name":"mrferos","email":"me@andresgalindo.us"},{"name":"onel0p3z","email":"onel0p3z@gmail.com"},{"name":"travis-fs","email":"development@flexshopper.com"}],"homepage":"https://github.com/FlexShopper/hapi-pres#readme","bugs":{"url":"https://github.com/FlexShopper/hapi-pres/issues"},"dist":{"shasum":"447fc9c39f0aa781e51ccc346d9f9af6befc9da2","tarball":"https://registry.npmjs.org/@flexshopper/hapi-pres/-/hapi-pres-3.0.0.tgz","integrity":"sha512-eKEaYvEqDZ4boB/g75gFgdbxZF+nxZ+/Cq6k2EyJ2zlQGO1kHP7Ic3pcgKLrAzgG2C/JScN9CXLnZaaSzdRhow==","signatures":[{"sig":"MEQCIHUkjC+qY1RW67ikvVJuwpfsqCGMwzAvlvQFayaL4PflAiAth5SnM3XevC5EZFC4v77f8D5PkZ6ygmu1gotGey7PMg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"447fc9c39f0aa781e51ccc346d9f9af6befc9da2","gitHead":"0cac0832bd24db44e695fe3fb5dac459459d6e53","scripts":{"dev":"nodemon lib/index.js -i logs","fix":"fixpack","test":"lab -t 100 -C -S -v -a code && npm run standards","start":"node lib/index.js","standards":"gulp eslint","test-cov-html":"lab -r html -o coverage/coverage.html"},"_npmUser":{"name":"ar4mirez","email":"angel@cuemby.com"},"repository":{"url":"git+https://github.com/FlexShopper/hapi-pres.git","type":"git"},"_npmVersion":"3.10.3","description":"Hapi plugin to autoload pres.","directories":{},"_nodeVersion":"6.3.1","dependencies":{"joi":"^9.0.4","glob":"^7.0.3","hoek":"^4.0.1","async":"^2.0.0-rc.6","lodash":"^4.16.1"},"devDependencies":{"lab":"^11.0.0","code":"^3.0.2","gulp":"^3.9.1","hapi":"^14.2.0","eslint":"^2.13.1","fixpack":"^2.3.1","nodemon":"^1.9.2","camelcase":"^3.0.0","gulp-eslint":"^2.0.0","estraverse-fb":"^1.3.1","eslint-config-yandex":"^1.0.6","@flexshopper/eslint-config-flexshopper":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/hapi-pres-3.0.0.tgz_1474665397158_0.8727957736700773","host":"packages-16-east.internal.npmjs.com"}},"3.1.0":{"name":"@flexshopper/hapi-pres","version":"3.1.0","keywords":["hapi","plugin"],"author":{"name":"Angel Ramirez","email":"angel.ramirez@flexshopper.com"},"license":"ISC","_id":"@flexshopper/hapi-pres@3.1.0","maintainers":[{"name":"ar4mirez","email":"angel@cuemby.com"},{"name":"charlle","email":"charleston.malkemus@flexshopper.com"},{"name":"gills","email":"john.gills@flexshopper.com"},{"name":"mrferos","email":"me@andresgalindo.us"},{"name":"onel0p3z","email":"onel0p3z@gmail.com"},{"name":"travis-fs","email":"development@flexshopper.com"}],"homepage":"https://github.com/FlexShopper/hapi-pres#readme","bugs":{"url":"https://github.com/FlexShopper/hapi-pres/issues"},"dist":{"shasum":"46e1989e1e749bba3c4e4f35ee742397510ece83","tarball":"https://registry.npmjs.org/@flexshopper/hapi-pres/-/hapi-pres-3.1.0.tgz","integrity":"sha512-OXQHuE+Jxa5xrqnbBM13RS6LlxYaer6pDWSbydHa87NPvw7ND9GIGUy3tzcE8170e+cIa1rlezHd7qMUWigG6Q==","signatures":[{"sig":"MEUCIQCOLIfzzNGZMRDtxtINkd5tp7dTofdAJ3HoVK14trd/EwIgNpYDu1PsBdjV3kPB3GjCU9lEI+XCVYMHnI08YP6HOdk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"46e1989e1e749bba3c4e4f35ee742397510ece83","gitHead":"2b388b31b684e05ac6595cfb5f99229d8f17bbb5","scripts":{"dev":"nodemon lib/index.js -i logs","fix":"fixpack","test":"lab -t 100 -C -S -v -a code && npm run standards","start":"node lib/index.js","standards":"gulp eslint","test-cov-html":"lab -r html -o coverage/coverage.html"},"_npmUser":{"name":"ar4mirez","email":"angel@cuemby.com"},"repository":{"url":"git+https://github.com/FlexShopper/hapi-pres.git","type":"git"},"_npmVersion":"3.10.3","description":"Hapi plugin to autoload pres.","directories":{},"_nodeVersion":"6.6.0","dependencies":{"joi":"^9.0.4","glob":"^7.0.3","hoek":"^4.0.1","async":"^2.0.0-rc.6","lodash":"^4.16.2","camelcase":"^3.0.0"},"devDependencies":{"lab":"^11.0.0","code":"^3.0.2","gulp":"^3.9.1","hapi":"^14.2.0","eslint":"^2.13.1","fixpack":"^2.3.1","nodemon":"^1.9.2","camelcase":"^3.0.0","gulp-eslint":"^2.0.0","estraverse-fb":"^1.3.1","eslint-config-yandex":"^1.0.6","@flexshopper/eslint-config-flexshopper":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/hapi-pres-3.1.0.tgz_1475175110413_0.7700773740652949","host":"packages-16-east.internal.npmjs.com"}}},"time":{"created":"2016-03-14T21:55:54.054Z","modified":"2026-08-13T16:32:17.823Z","1.0.0":"2016-03-14T21:55:54.054Z","1.0.3":"2016-03-15T20:20:48.732Z","1.0.4":"2016-03-16T20:10:31.616Z","2.0.0":"2016-06-20T17:49:02.292Z","3.0.0":"2016-09-23T21:16:38.339Z","3.1.0":"2016-09-29T18:51:51.346Z"},"bugs":{"url":"https://github.com/FlexShopper/hapi-pres/issues"},"author":{"name":"Angel Ramirez","email":"angel.ramirez@flexshopper.com"},"license":"ISC","homepage":"https://github.com/FlexShopper/hapi-pres#readme","keywords":["hapi","plugin"],"repository":{"url":"git+https://github.com/FlexShopper/hapi-pres.git","type":"git"},"description":"Hapi plugin to autoload pres.","maintainers":[{"email":"administrator@flexshopper.com","name":"travis-fs"},{"email":"danish.kazmi@flexshopper.com","name":"danishkazmi"},{"email":"leo.stanley@flexshopper.com","name":"fs-lstanley"},{"email":"mario.carballosa@flexshopper.com","name":"mcarballosa"}],"readme":"# @flexshopper/hapi-pres\n[![Build Status][travis-badge]][travis-url]\n[![Dependencies][david-badge]][david-url]\n[![Dev dependencies][david-dev-badge]][david-url]\n\n[travis-badge]: https://travis-ci.com/FlexShopper/hapi-pres.svg?token=Y5c2Yh3HiTw9G5oH7ZkQ&branch=master\n[travis-url]: https://travis-ci.com/FlexShopper/hapi-pres\n[david-badge]: https://david-dm.org/flexshopper/hapi-pres.svg\n[david-dev-badge]: https://david-dm.org/flexshopper/hapi-pres/dev-status.svg\n[david-url]: https://david-dm.org/flexshopper/hapi-pres\n[david-dev-url]: https://david-dm.org/flexshopper/hapi-pres#info=devDependencies\n\nPlugin to autoload pres based on patterns.\n\n### How to use:\n- Install `hapi-pres` npm package in your project our plugin.\n`npm i @flexshopper/hapi-pres`\n- Register plugin in your hapi server:\n\n### Registering\n\nKraken service style:\n\n``` javascript\nconst server = new Hapi.Server();\n\nserver.connection();\n\nserver.register({\n    register: require('hapi-routes'),\n    options: {\n        relativeTo: proccess.cwd() + '/pres',\n        includes: ['path/to/**/*pres.js'],\n        ignore: ['*.git'],\n    }\n}, (err) => {\n  // continue application\n});\n```\nManifest style:\n\n```javascript\nregistrations: [\n    ...\n    {\n        plugin: {\n            register: 'hapi-pres',\n            options: {\n                relativeTo: proccess.cwd() + '/pres',\n                includes: ['path/to/**/*pres.js'],\n                ignore: ['*.git'],\n            }\n        }\n    }\n];\n```\n\n### Options\n##### includes\n\n*Required* <br/>\nType: `array`\n\nThe [glob](https://github.com/isaacs/node-glob) pattern you would like to include\n\n##### ignore\n\nType: `array`\n\nThe pattern or an array of patterns to exclude\n\n##### relativeTo\n\nType: `string`\n\nThe current working directory in which to search (defaults to `process.cwd()`)\n\n### Pre-requirement Signature(Version 2.x.x and before)\n```javascript\nconst internals = module.exports = {};\n\ninternals.assign = 'myAwesomePre';\ninternals.method = (request, reply) => {\n    return reply(request.query);\n};\n\n// then in the routes\nserver.route({\n    method: 'GET',\n    path: '/ping',\n    config: {\n        pre: [\n             server.pre.myAwesomePre\n        ],\n        handler: (request, reply) => {\n             return reply(request.pre.example);\n        }\n    }   \n});\n```\n### Pre-requirement Signature(Version 3.x.x and after)\n```javascript\n// in you pre-handler file\nconst internals = module.exports = {};\n\ninternals.myAwesomePre = (request, reply) => {\n\n    return reply('myAwesomePre');\n}\n\ninternals.mySecondAwesomePre = (request, reply) => {\n    \n    return reply('mySecondAwesomePre');\n}\n\n// assume your pre-handler file name is my-Pre.js\n// then in the routes\nserver.route({\n    method: 'GET',\n    path: '/ping',\n    config: {\n        pre: [\n            server.pre.myPre.myAwesomePre,\n            server.pre.myPre.mySecondAwesomePre\n        ],\n        handler: (request, reply) => {\n            return reply('handler');\n        }\n    }\n});\n\n// if you need to get result from pre handler\nrequest.pre.myAwesomePre\nrequest.pre.mySecondAwesomePre\n```\n\n### Cautions\n- Please do not name two different pre-handlers with same name, even in different files. Otherwise they won't be accessed correctly.\n","readmeFilename":"README.md"}