{"_id":"@alperderici/pm2-hooks","_rev":"6-1fae062b2e52990ac7a36be5c9233287","name":"@alperderici/pm2-hooks","dist-tags":{"latest":"1.1.27"},"versions":{"1.1.20":{"name":"@alperderici/pm2-hooks","version":"1.1.20","description":"Webhook server for pm2, compatible with any git repository","main":"dist/index.js","scripts":{"build":"babel src --out-dir dist --copy-files","lint":"eslint src test","pretest":"npm run lint","test":"NODE_ENV=test _mocha","test:cover":"istanbul cover ./node_modules/.bin/_mocha"},"repository":{"type":"git","url":"git+https://github.com/desaroger/pm2-hooks.git"},"keywords":["pm2","webhooks"],"author":{"name":"Roger Fos Soler","url":"desaroger23@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/desaroger/pm2-hooks/issues"},"homepage":"https://github.com/desaroger/pm2-hooks#readme","dependencies":{"babel-regenerator-runtime":"^6.5.0","body-parser":"^1.20.1","co":"^4.6.0","concurrently":"^7.6.0","ipaddr.js":"^2.0.1","lerna":"^6.1.0","lodash":"^4.17.21","nx":"^15.2.4","pm2":"^5.2.2","pmx":"^1.6.7","promisify-node":"^0.5.0","require-dir":"^1.2.0"},"devDependencies":{"babel":"^6.23.0","babel-cli":"^6.26.0","babel-preset-es2015":"^6.24.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","chai-shallow-deep-equal":"^1.4.6","eslint":"^8.29.0","eslint-config-airbnb":"^19.0.4","eslint-plugin-import":"^2.26.0","eslint-plugin-jsx-a11y":"^6.6.1","eslint-plugin-react":"^7.31.11","istanbul":"^0.4.5","mocha":"^10.1.0","mock-spawn":"^0.2.6","request":"^2.88.2","request-promise":"^4.2.6","sinon":"^15.0.0","url-join":"^5.0.0"},"gitHead":"901355f2ba955704182b73afe347acbc35d8acd3","_id":"@alperderici/pm2-hooks@1.1.20","_nodeVersion":"19.2.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-Tv61VhvebzLsl/6cGEsLhf+njC8KKOmGSLhwIRYyDoSOM6oiPmr9L0oYkjdoVpgfVWpltiZ+jIGxIYngy9U+ZA==","shasum":"991a36fbdc3442d2b70a5685c58682ef23d5882a","tarball":"https://registry.npmjs.org/@alperderici/pm2-hooks/-/pm2-hooks-1.1.20.tgz","fileCount":37,"unpackedSize":117037,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQDOBwkB702fDupUEPeQIMGdpXJrqt+L4dpkmPQhaZ28WAIfCnaqKkRBBcZeCr+sicYRvi9N4GR8IIEHy4lL3z2d+A=="}]},"_npmUser":{"name":"alperderici","email":"alper.derici@gmail.com"},"directories":{},"maintainers":[{"name":"alperderici","email":"alper.derici@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pm2-hooks_1.1.20_1690680383807_0.6818687682232685"},"_hasShrinkwrap":false},"1.1.21":{"name":"@alperderici/pm2-hooks","version":"1.1.21","description":"Webhook server for pm2, compatible with any git repository","main":"dist/index.js","scripts":{"build":"babel src --out-dir dist --copy-files","lint":"eslint src test","pretest":"npm run lint","test":"NODE_ENV=test _mocha","test:cover":"istanbul cover ./node_modules/.bin/_mocha"},"repository":{"type":"git","url":"git+https://github.com/desaroger/pm2-hooks.git"},"keywords":["pm2","webhooks"],"author":{"name":"Roger Fos Soler","url":"desaroger23@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/desaroger/pm2-hooks/issues"},"homepage":"https://github.com/desaroger/pm2-hooks#readme","dependencies":{"babel-regenerator-runtime":"^6.5.0","body-parser":"^1.20.1","co":"^4.6.0","concurrently":"^7.6.0","dotenv":"^16.3.1","ipaddr.js":"^2.0.1","lerna":"^6.1.0","lodash":"^4.17.21","nx":"^15.2.4","pm2":"^5.2.2","pmx":"^1.6.7","promisify-node":"^0.5.0","require-dir":"^1.2.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-preset-es2015":"^6.24.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","chai-shallow-deep-equal":"^1.4.6","eslint":"^8.29.0","eslint-config-airbnb":"^19.0.4","eslint-plugin-import":"^2.26.0","eslint-plugin-jsx-a11y":"^6.6.1","eslint-plugin-react":"^7.31.11","istanbul":"^0.4.5","mocha":"^10.1.0","mock-spawn":"^0.2.6","request":"^2.88.2","request-promise":"^4.2.6","sinon":"^15.0.0","url-join":"^5.0.0"},"gitHead":"901355f2ba955704182b73afe347acbc35d8acd3","_id":"@alperderici/pm2-hooks@1.1.21","_nodeVersion":"19.2.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-xQwyTMF79uE7LScC+wHrzpdz8f+40T8exyio0LMr75AymItaMwcyLbVwIAaKIFL8D2ulhlNYELjiH0R3EQ8vwA==","shasum":"736769f7b986eba2c87ba4f186739ed29137561e","tarball":"https://registry.npmjs.org/@alperderici/pm2-hooks/-/pm2-hooks-1.1.21.tgz","fileCount":37,"unpackedSize":117390,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE0nzAyfifvpdvHwO9D4tblmZSUGTEfzu2YrVDkQ9/PmAiEA9tCOgez2zPH8mieP9knq+HPm8h4VB+u6FaT+J86LuSk="}]},"_npmUser":{"name":"alperderici","email":"alper.derici@gmail.com"},"directories":{},"maintainers":[{"name":"alperderici","email":"alper.derici@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pm2-hooks_1.1.21_1690683865320_0.9122880680520487"},"_hasShrinkwrap":false},"1.1.22":{"name":"@alperderici/pm2-hooks","version":"1.1.22","description":"Webhook server for pm2, compatible with any git repository","main":"dist/index.js","scripts":{"build":"babel src --out-dir dist --copy-files","lint":"eslint src test","pretest":"npm run lint","test":"NODE_ENV=test _mocha","test:cover":"istanbul cover ./node_modules/.bin/_mocha"},"repository":{"type":"git","url":"git+https://github.com/desaroger/pm2-hooks.git"},"keywords":["pm2","webhooks"],"author":{"name":"Roger Fos Soler","url":"desaroger23@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/desaroger/pm2-hooks/issues"},"homepage":"https://github.com/desaroger/pm2-hooks#readme","dependencies":{"babel-regenerator-runtime":"^6.5.0","body-parser":"^1.20.1","co":"^4.6.0","concurrently":"^7.6.0","dotenv":"^16.3.1","ipaddr.js":"^2.0.1","lerna":"^6.1.0","lodash":"^4.17.21","nx":"^15.2.4","pm2":"^5.2.2","pmx":"^1.6.7","promisify-node":"^0.5.0","require-dir":"^1.2.0"},"devDependencies":{"@babel/cli":"^7.22.9","@babel/preset-env":"^7.22.9","chai":"^4.3.7","chai-as-promised":"^7.1.1","chai-shallow-deep-equal":"^1.4.6","eslint":"^8.29.0","eslint-config-airbnb":"^19.0.4","eslint-plugin-import":"^2.26.0","eslint-plugin-jsx-a11y":"^6.6.1","eslint-plugin-react":"^7.31.11","istanbul":"^0.4.5","mocha":"^10.1.0","mock-spawn":"^0.2.6","request":"^2.88.2","request-promise":"^4.2.6","sinon":"^15.0.0","url-join":"^5.0.0"},"gitHead":"901355f2ba955704182b73afe347acbc35d8acd3","_id":"@alperderici/pm2-hooks@1.1.22","_nodeVersion":"19.2.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-DtJ/zXnHMqyTLrhUljVtHK9XSApiqirYVNEVrQt+8v3q9OlIubwxbb/c63VfV1spuhJ//WypxUXI5Woumv4/og==","shasum":"9bdcfa3ac33cc79ce3df501c8168b256dbe7a9b3","tarball":"https://registry.npmjs.org/@alperderici/pm2-hooks/-/pm2-hooks-1.1.22.tgz","fileCount":37,"unpackedSize":128092,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHgj5YqLqbrAxqiAKklGAQk518+VkHyjY178r7ltucNwAiBDywb10oWy1ncqLyBQhm14fjsBJg1N+2B7R2HFYELiEw=="}]},"_npmUser":{"name":"alperderici","email":"alper.derici@gmail.com"},"directories":{},"maintainers":[{"name":"alperderici","email":"alper.derici@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pm2-hooks_1.1.22_1690686854796_0.09436344364770322"},"_hasShrinkwrap":false},"1.1.23":{"name":"@alperderici/pm2-hooks","version":"1.1.23","description":"Webhook server for pm2, compatible with any git repository","main":"dist/index.js","scripts":{"build":"babel src --out-dir dist --copy-files","lint":"eslint src test","pretest":"npm run lint","test":"NODE_ENV=test _mocha","test:cover":"istanbul cover ./node_modules/.bin/_mocha"},"repository":{"type":"git","url":"git+https://github.com/desaroger/pm2-hooks.git"},"keywords":["pm2","webhooks"],"author":{"name":"Roger Fos Soler","url":"desaroger23@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/desaroger/pm2-hooks/issues"},"homepage":"https://github.com/desaroger/pm2-hooks#readme","dependencies":{"babel-regenerator-runtime":"^6.5.0","body-parser":"^1.20.1","co":"^4.6.0","concurrently":"^7.6.0","dotenv":"^16.3.1","ipaddr.js":"^2.0.1","lerna":"^6.1.0","lodash":"^4.17.21","nx":"^15.2.4","pm2":"^5.2.2","pmx":"^1.6.7","promisify-node":"^0.5.0","require-dir":"^1.2.0"},"devDependencies":{"@babel/cli":"^7.22.9","@babel/preset-env":"^7.22.9","chai":"^4.3.7","chai-as-promised":"^7.1.1","chai-shallow-deep-equal":"^1.4.6","eslint":"^8.29.0","eslint-config-airbnb":"^19.0.4","eslint-plugin-import":"^2.26.0","eslint-plugin-jsx-a11y":"^6.6.1","eslint-plugin-react":"^7.31.11","istanbul":"^0.4.5","mocha":"^10.1.0","mock-spawn":"^0.2.6","request":"^2.88.2","request-promise":"^4.2.6","sinon":"^15.0.0","url-join":"^5.0.0"},"gitHead":"901355f2ba955704182b73afe347acbc35d8acd3","_id":"@alperderici/pm2-hooks@1.1.23","_nodeVersion":"19.2.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-CFzCv3qeYqC++pBOBt1tcBZMff6jdd50FYaKqCw46CQMrOj59rQkIceVyOOp/6OYlouLsgMh7G/NrOSfvJUdow==","shasum":"4a0a7ac212466d951c4c53a674835d6eb74c39f6","tarball":"https://registry.npmjs.org/@alperderici/pm2-hooks/-/pm2-hooks-1.1.23.tgz","fileCount":37,"unpackedSize":129439,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCC0nDbp7fT9wFtecpkjvxk958Os79Os3Y+6UgHTwO4awIgOTeqoLoqaVAxCP/yGl+UUd8HazvFUX8wwGtdDWV2VPM="}]},"_npmUser":{"name":"alperderici","email":"alper.derici@gmail.com"},"directories":{},"maintainers":[{"name":"alperderici","email":"alper.derici@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pm2-hooks_1.1.23_1690688232126_0.7054751602588969"},"_hasShrinkwrap":false},"1.1.24":{"name":"@alperderici/pm2-hooks","version":"1.1.24","description":"Webhook server for pm2, compatible with any git repository","main":"dist/index.js","scripts":{"build":"babel src --out-dir dist --copy-files","lint":"eslint src test","pretest":"npm run lint","test":"NODE_ENV=test _mocha","test:cover":"istanbul cover ./node_modules/.bin/_mocha"},"repository":{"type":"git","url":"git+https://github.com/desaroger/pm2-hooks.git"},"keywords":["pm2","webhooks"],"author":{"name":"Roger Fos Soler","url":"desaroger23@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/desaroger/pm2-hooks/issues"},"homepage":"https://github.com/desaroger/pm2-hooks#readme","dependencies":{"babel-regenerator-runtime":"^6.5.0","body-parser":"^1.20.1","co":"^4.6.0","concurrently":"^7.6.0","dotenv":"^16.3.1","ipaddr.js":"^2.0.1","lerna":"^6.1.0","lodash":"^4.17.21","nx":"^15.2.4","pm2":"^5.2.2","pmx":"^1.6.7","promisify-node":"^0.5.0","require-dir":"^1.2.0"},"devDependencies":{"@babel/cli":"^7.22.9","@babel/preset-env":"^7.22.9","chai":"^4.3.7","chai-as-promised":"^7.1.1","chai-shallow-deep-equal":"^1.4.6","eslint":"^8.29.0","eslint-config-airbnb":"^19.0.4","eslint-plugin-import":"^2.26.0","eslint-plugin-jsx-a11y":"^6.6.1","eslint-plugin-react":"^7.31.11","istanbul":"^0.4.5","mocha":"^10.1.0","mock-spawn":"^0.2.6","request":"^2.88.2","request-promise":"^4.2.6","sinon":"^15.0.0","url-join":"^5.0.0"},"gitHead":"901355f2ba955704182b73afe347acbc35d8acd3","_id":"@alperderici/pm2-hooks@1.1.24","_nodeVersion":"19.2.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-r+xA0t+UGqSJ20wvrbmylLg17dcvpTXsO9olV0lcjHBp2oK231ev0rLMZ66mGztyKs0G4Ctk86zkG+PTRjtBhw==","shasum":"b99884514ccdf422c07b200fa573c8914f2529fb","tarball":"https://registry.npmjs.org/@alperderici/pm2-hooks/-/pm2-hooks-1.1.24.tgz","fileCount":37,"unpackedSize":129439,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCC2Pg1SibmrZc/uTo0S3lqWBLNGs5mpdNd5TmLr3mnOwIgf+HSowjdVgt1qEidgtW5z8NrBrWq9Ano41bYCFtxm/k="}]},"_npmUser":{"name":"alperderici","email":"alper.derici@gmail.com"},"directories":{},"maintainers":[{"name":"alperderici","email":"alper.derici@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pm2-hooks_1.1.24_1690688271856_0.2779192172157974"},"_hasShrinkwrap":false},"1.1.26":{"name":"@alperderici/pm2-hooks","version":"1.1.26","description":"Webhook server for pm2, compatible with any git repository","main":"dist/index.js","scripts":{"build":"babel src --out-dir dist --copy-files","lint":"eslint src test","pretest":"npm run lint","test":"NODE_ENV=test _mocha","test:cover":"istanbul cover ./node_modules/.bin/_mocha"},"repository":{"type":"git","url":"git+https://github.com/desaroger/pm2-hooks.git"},"keywords":["pm2","webhooks"],"author":{"name":"Roger Fos Soler","url":"desaroger23@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/desaroger/pm2-hooks/issues"},"homepage":"https://github.com/desaroger/pm2-hooks#readme","dependencies":{"babel-regenerator-runtime":"^6.5.0","body-parser":"^1.20.1","co":"^4.6.0","concurrently":"^7.6.0","dotenv":"^16.3.1","ipaddr.js":"^2.0.1","lerna":"^6.1.0","lodash":"^4.17.21","nx":"^15.2.4","pm2":"^5.2.2","pmx":"^1.6.7","promisify-node":"^0.5.0","require-dir":"^1.2.0"},"devDependencies":{"@babel/cli":"^7.22.9","@babel/preset-env":"^7.22.9","chai":"^4.3.7","chai-as-promised":"^7.1.1","chai-shallow-deep-equal":"^1.4.6","eslint":"^8.29.0","eslint-config-airbnb":"^19.0.4","eslint-plugin-import":"^2.26.0","eslint-plugin-jsx-a11y":"^6.6.1","eslint-plugin-react":"^7.31.11","istanbul":"^0.4.5","mocha":"^10.1.0","mock-spawn":"^0.2.6","request":"^2.88.2","request-promise":"^4.2.6","sinon":"^15.0.0","url-join":"^5.0.0"},"gitHead":"3b904f97831b5c43c7e5d3f82c70b6131c8e8638","_id":"@alperderici/pm2-hooks@1.1.26","_nodeVersion":"19.2.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-/r49Bd/c0U9zO+sMmLDOOG/EZisviYXIsa6v+9ihQW0KHaJTVgtp/OjyIjL93lrknNxCLWiPNksPAwC0VQ7qpg==","shasum":"b09cc6591276944ecb8013017a586a8ba36787a8","tarball":"https://registry.npmjs.org/@alperderici/pm2-hooks/-/pm2-hooks-1.1.26.tgz","fileCount":37,"unpackedSize":130081,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFqbVJhxQvomPCkzHZpJ6Kn9LOYXQMTjPeQE9evwS+NRAiAuVWPHhjHLL2AcGHjbWsw/zYrXdX/tU7YiJj+2kMP/rA=="}]},"_npmUser":{"name":"alperderici","email":"alper.derici@gmail.com"},"directories":{},"maintainers":[{"name":"alperderici","email":"alper.derici@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pm2-hooks_1.1.26_1690689578333_0.6591130799259131"},"_hasShrinkwrap":false},"1.1.27":{"name":"@alperderici/pm2-hooks","version":"1.1.27","description":"Webhook server for pm2, compatible with any git repository","main":"dist/index.js","scripts":{"build":"babel src --out-dir dist --copy-files","lint":"eslint src test","pretest":"npm run lint","test":"NODE_ENV=test _mocha","test:cover":"istanbul cover ./node_modules/.bin/_mocha"},"repository":{"type":"git","url":"git+https://github.com/desaroger/pm2-hooks.git"},"keywords":["pm2","webhooks"],"author":{"name":"Roger Fos Soler","url":"desaroger23@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/desaroger/pm2-hooks/issues"},"homepage":"https://github.com/desaroger/pm2-hooks#readme","dependencies":{"babel-regenerator-runtime":"^6.5.0","body-parser":"^1.20.1","co":"^4.6.0","concurrently":"^7.6.0","dotenv":"^16.3.1","ipaddr.js":"^2.0.1","lerna":"^6.1.0","lodash":"^4.17.21","nx":"^15.2.4","pm2":"^5.2.2","pmx":"^1.6.7","promisify-node":"^0.5.0","require-dir":"^1.2.0"},"devDependencies":{"@babel/cli":"^7.22.9","@babel/preset-env":"^7.22.9","chai":"^4.3.7","chai-as-promised":"^7.1.1","chai-shallow-deep-equal":"^1.4.6","eslint":"^8.29.0","eslint-config-airbnb":"^19.0.4","eslint-plugin-import":"^2.26.0","eslint-plugin-jsx-a11y":"^6.6.1","eslint-plugin-react":"^7.31.11","istanbul":"^0.4.5","mocha":"^10.1.0","mock-spawn":"^0.2.6","request":"^2.88.2","request-promise":"^4.2.6","sinon":"^15.0.0","url-join":"^5.0.0"},"gitHead":"3b904f97831b5c43c7e5d3f82c70b6131c8e8638","_id":"@alperderici/pm2-hooks@1.1.27","_nodeVersion":"19.2.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-G3ajCQgIDxcnR/hDBhMibeb8YcuON9nrcvaS+evYpFHQIwAvQwlcfd93OY+VEqzGRB9I8jBF8i21ggBqgkZ5XA==","shasum":"38b49b3dabcb11cc1ab7708e24ad54ce4fef2a51","tarball":"https://registry.npmjs.org/@alperderici/pm2-hooks/-/pm2-hooks-1.1.27.tgz","fileCount":37,"unpackedSize":129974,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvU6fnwBJs8AMmdLvIXM1wz67OVoSssHYIiuSUvpzi8QIgdL/uaKRf2ptUB1gEA4KxFp3hHADymFTIkMm8zlORxoI="}]},"_npmUser":{"name":"alperderici","email":"alper.derici@gmail.com"},"directories":{},"maintainers":[{"name":"alperderici","email":"alper.derici@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pm2-hooks_1.1.27_1690689933563_0.6054083682776563"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-30T01:26:23.749Z","1.1.20":"2023-07-30T01:26:23.980Z","modified":"2023-07-30T04:05:33.840Z","1.1.21":"2023-07-30T02:24:25.475Z","1.1.22":"2023-07-30T03:14:14.968Z","1.1.23":"2023-07-30T03:37:12.302Z","1.1.24":"2023-07-30T03:37:52.007Z","1.1.26":"2023-07-30T03:59:38.524Z","1.1.27":"2023-07-30T04:05:33.744Z"},"maintainers":[{"name":"alperderici","email":"alper.derici@gmail.com"}],"description":"Webhook server for pm2, compatible with any git repository","homepage":"https://github.com/desaroger/pm2-hooks#readme","keywords":["pm2","webhooks"],"repository":{"type":"git","url":"git+https://github.com/desaroger/pm2-hooks.git"},"author":{"name":"Roger Fos Soler","url":"desaroger23@gmail.com"},"bugs":{"url":"https://github.com/desaroger/pm2-hooks/issues"},"license":"ISC","readme":"# pm2-hooks\n\n[![GitHub version][fury-badge]][fury-url]\n[![Travis-CI][travis-badge]][travis-url]\n[![Codeclimate][codeclimate-badge]][codeclimate-url]\n[![Codeclimate Coverage][codeclimate-cov-badge]][codeclimate-cov-url]\n[![Dependency][david-badge]][david-url]\n[![DevDependency][david-dev-badge]][david-dev-url]\n\nPM2 module to listen webhooks from github, bitbucket, gitlab, jenkins and droneci. When a webhook is received you can run a script, pull your project, restart pm2, etc.\n\nThis project is highly inspired by [vmarchaud/pm2-githook](https://github.com/vmarchaud/pm2-githook).\n\nFeatures ([changelog](/CHANGELOG.md)):\n\n- Runs an http server listening for webhooks\n- Works on any repository system, as for now it does nothing with the payload received. In the near future I will check the branch or the action, the secret, etc.\n- Only runs the command you set\n- Run the command in the cwd defined for the app\n\nWanted features, to be done during Mach/2017:\n\n- Check payload for secret, check common headers on main git repositories (github, bitbucket, gitlab, etc) to know if is a valid call\n\nPossible features, as I need to think about it:\n\n- Auto-restart pm2 app after a successful command run\n- Make an automatic `git pull` on the folder, and make a `prePull` and `postPull` available commands (same approach as [vmarchaud/pm2-githook](https://github.com/vmarchaud/pm2-githook))\n\n# Install\n\nTo install it simply run:\n\n```bash\n$ pm2 install pm2-hooks\n```\n\nWarning: This library currently (2017 feb 26) is in ALPHA state. This means some things:\n\n- You can help me a lot making a comment/issue/PR\n- I will try to publish the last version to npm so you can install it with only `pm2 install pm2-hooks`. If for some reason the version on npm is outdated you always will be capable of run `pm2 install desaroger/pm2-hooks` to be sure to install the last version directly from the repository.\n\n\n# Usage\n\n## Step 1: Prepare the ecosystem file\n\nBy default **pm2-hooks** doesn't do anything. You need to set the key `env_hook` inside the config of a given app, inside the ecosystem file.\n\nIf env_hook isn't defined or is falsy then is disabled.\n\nExample of an ecosystem file:\n\n```js\n{\n\tapps: [\n\t\t{\n\t\t\tname: 'api-1',\n\t\t\tscript: 'server.js'\n\t\t},\n\t\t{\n\t\t\tname: 'api-2',\n\t\t\tscript: 'server.js',\n\t\t\tenv_hook: {\n\t\t\t\tcommand: 'git pull && npm i && npm test && pm2 restart api-2',\n\t\t\t\tcwd: '/home/desaroger'\n\t\t\t}\n\t\t}\n\t]\n}\n```\n\nWhere **api-1** has hook disabled and **api-2** is enabled and when the hook is called, the command is executed.\n\n### Available options:\n\n- **command** *{string}* The line you want to execute. Will be executed with NodeJS `spawn`. (optional, but if not set this is not going to do nothing ¯\\\\_(ツ)_/¯)\n- **cwd** *{string}* The cwd to use when running the command. If not set, the one used on your ecosystem app configuration will be used (if set).\n- **commandOptions** *{object}* The object that we will pass to the NodeJS `spawn`. Defaults to a blank object, and later we add the *cwd*.\n- **type** *{string}* [not implemented yet] The git server you are going to use [github, gitlab, bitbucket, etc].\n\n## Step 2: Install\n\nIf you didn't install before, install it. If you installed it, then you will need to restart it. For that, run `pm2 restart pm2-hooks`.\n\n## Step 3: Try it\n\nNow you have a server on port 9000 by default. You can make a call to `http://localhost:9000/api-2` to see the response.\n\nIf everything went fine, you will see:\n\n```js\n{\n\tstatus: 'success',\n\tmessage: 'Route \"api-2\" was found'\n\tcode: 0\n}\n```\n\nAnd the command had been executed.\n\n## Step 4: See the log\n\nEverything will be logged in the pm2 logs. For see them, run:\n\n```bash\n$ pm2 logs pm2-hooks\n```\n\nAnd for see the entire log:\n\n```bash\n$ cat ~/.pm2/logs/pm2-hooks-out-0.log\n```\n\n# FAQ\n\n## How I can change the port?\n\nYou can set the port (where the default port is 9000) setting it in the config of the pm2 module. For doing that, run:\n\n```bash\n$ pm2 set pm2-hooks:port 3000\n```\n\n## How I can uninstall it?\n\nYou can uninstall this module running:\n\n```bash\n$ pm2 uninstall pm2-hooks\n```\n\n# Another similar projects\n\nThese are some projects I found similar to mine. Please let me know if you know anoher.\n\n- [vmarchaud/pm2-githook](https://github.com/vmarchaud/pm2-githook): From where I was inspired. It works on any repository, pulls the repo when webhook is called and has *preHook* and *postHook* commands available.\n- [oowl/pm2-webhook](https://github.com/oowl/pm2-webhook): Works on any repository. If you want to use the *secret*, then the webhook must contain the *X-Hub-Signature* in order to work (I don't know if every git server contains it).\n\n# Copyright and license\n\nCopyright 2017 Roger Fos Soler\n\nLicensed under the [MIT License](/LICENSE).\n\n\n[npm-badge]: https://img.shields.io/npm/v/pm2-hooks.svg\n[npm-url]: https://www.npmjs.com/package/pm2-hooks\n\n[fury-badge]: https://badge.fury.io/js/pm2-hooks.svg\n[fury-url]: https://www.npmjs.com/package/pm2-hooks\n\n[travis-badge]: https://travis-ci.org/desaroger/pm2-hooks.svg\n[travis-url]: https://travis-ci.org/desaroger/pm2-hooks\n\n[david-badge]: https://david-dm.org/desaroger/pm2-hooks.svg\n[david-url]: https://david-dm.org/desaroger/pm2-hooks\n[david-dev-badge]: https://david-dm.org/desaroger/pm2-hooks/dev-status.svg\n[david-dev-url]: https://david-dm.org/desaroger/pm2-hooks#info=devDependencies\n\n[gemnasium-badge]: https://gemnasium.com/badges/github.com/desaroger/pm2-hooks.svg\n[gemnasium-url]: https://gemnasium.com/github.com/desaroger/pm2-hooks\n\n[codeclimate-badge]: https://codeclimate.com/github/desaroger/pm2-hooks/badges/gpa.svg\n[codeclimate-url]: https://codeclimate.com/github/desaroger/pm2-hooks\n\n[codeclimate-cov-badge]: https://codeclimate.com/github/desaroger/pm2-hooks/badges/coverage.svg?hash=1\n[codeclimate-cov-url]: https://codeclimate.com/github/desaroger/pm2-hooks/coverage\n\n[coverage-badge]: https://codeclimate.com/github/desaroger/pm2-hooks/badges/coverage.svg\n[coverage-url]: https://codeclimate.com/github/desaroger/pm2-hooks/coverage\n","readmeFilename":"README.md"}