{"id":16758417,"url":"https://github.com/kessler/serverless-onehook","last_synced_at":"2025-09-12T23:45:35.768Z","repository":{"id":57124445,"uuid":"200408024","full_name":"kessler/serverless-onehook","owner":"kessler","description":"one hook to rule them all","archived":false,"fork":false,"pushed_at":"2021-01-16T11:29:14.000Z","size":2,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T08:12:40.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kessler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-03T18:24:00.000Z","updated_at":"2023-12-10T15:10:09.000Z","dependencies_parsed_at":"2022-08-27T12:53:07.762Z","dependency_job_id":null,"html_url":"https://github.com/kessler/serverless-onehook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fserverless-onehook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fserverless-onehook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fserverless-onehook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fserverless-onehook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kessler","download_url":"https://codeload.github.com/kessler/serverless-onehook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841986,"owners_count":20356583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T04:05:14.712Z","updated_at":"2025-03-16T08:20:27.746Z","avatar_url":"https://github.com/kessler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless one hook\n\n- easily create plugins without publishing them \n- assign a hook before and after all existing hooks\n\n`npm i -s @kessler/serverless-onehook`\n\n```yaml\nplugins:\n    - \"@kessler/serverless-onehook\"\n```\ncreate a `oneHook.js` at the base of your project:\n```js\nmodule.exports = (onehook) =\u003e {\n    // this module is run in during the construction of the plugin instance\n    // so you can do anything that you would do in a normal sls plugin class\n    onehook.commands = { ... }\n    onehook.hooks = { ... }\n\n    // but also, you can just skip the whole plugin class thing and just do hooks\n    onehook.before('deploy:deploy', () =\u003e {})\n\n    // will run before the \"after\" of deploy deploy\n    onehook.before('after:deploy:deploy', () =\u003e { })\n\n    // will run after the \"after\" of deploy deploy\n    onehook.after('after:deploy:deploy', () =\u003e { })\n\n    // an array containing all existing hook names\n    // please note that what you get here probably (but i didn't check) depends\n    // on the plugin load order, but in any case, all the core plugins (but not enterprise)\n    // are loaded before this plugin\n    console.log(onehook.existingHookNames)\n}\n```\n\n### customize the location of oneHook.js\n\n```yaml\nplugins:\n    - \"@kessler/serverless-onehook\"\ncustom:\n    hookPath: something relative to project root (sls project roo)\n```\n\n### hooks reference\nhttps://gist.github.com/HyperBrain/50d38027a8f57778d5b0f135d80ea406","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Fserverless-onehook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkessler%2Fserverless-onehook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Fserverless-onehook/lists"}