{"id":21935375,"url":"https://github.com/zeecoder/z-hook-finder","last_synced_at":"2026-05-09T13:02:11.106Z","repository":{"id":33553093,"uuid":"37199294","full_name":"ZeeCoder/z-hook-finder","owner":"ZeeCoder","description":"Finds JS hooks in a given DOM element, inspired by the BEM methodology.","archived":false,"fork":false,"pushed_at":"2015-06-23T21:20:45.000Z","size":164,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T18:10:35.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZeeCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-10T13:38:38.000Z","updated_at":"2017-12-19T22:25:11.000Z","dependencies_parsed_at":"2022-09-16T09:01:25.924Z","dependency_job_id":null,"html_url":"https://github.com/ZeeCoder/z-hook-finder","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeCoder%2Fz-hook-finder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeCoder%2Fz-hook-finder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeCoder%2Fz-hook-finder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeCoder%2Fz-hook-finder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZeeCoder","download_url":"https://codeload.github.com/ZeeCoder/z-hook-finder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244966462,"owners_count":20539794,"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-11-29T00:19:46.496Z","updated_at":"2026-05-09T13:02:06.041Z","avatar_url":"https://github.com/ZeeCoder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# z-hook-finder\n[![Build Status](https://travis-ci.org/ZeeCoder/z-hook-finder.svg?branch=master)](https://travis-ci.org/ZeeCoder/z-hook-finder)\n[![npm version](https://badge.fury.io/js/z-hook-finder.svg)](http://badge.fury.io/js/z-hook-finder)\n\n## What is it\nThis module was created to handle a [BEM](http://bem.info)-like solution to find JS \"hooks\".\n\nHere a JS hook means the same for a module as a BEM element means for a block.\n\nAs an additional \"convention\", I use a `js-` prefix for the classnames, which is\nused to differenciate JS classes from classes used solely for design by CSS.\n\n## Example, explanations:\n\n```html\n\u003c!-- The \"module\" JS module --\u003e\n\u003cdiv id=\"js-module\"\u003e\n    \u003cdiv class=\"js-module__button\"\u003e\u003c/div\u003e\n    \u003cdiv class=\"js-module__button\"\u003e\u003c/div\u003e\n    \u003cdiv class=\"js-module__button\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n```js\nvar HookFinder = require('z-hook-finder');\n\nvar finder = new HookFinder($('#js-module'), 'js-module__');\n// Alternatively you can pass the separator \"__\" or something else as the third\n// parameter: `new HookFinder($('#js-module'), 'js-module', '__');`\n\nfinder.find('button');\n// -\u003e returns the jQuery object for the DOM element\n\nfinder.find('button', 2);\n// -\u003e returns only the first 2 buttons, and outputs a console error\n```\n\nSince this is a CommonJS module, it must be used alongside with [Browserify](http://browserify.org/), or\nsomething similar, like [WebPacker](http://webpack.github.io/).\n\n## License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeecoder%2Fz-hook-finder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeecoder%2Fz-hook-finder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeecoder%2Fz-hook-finder/lists"}