{"id":16350321,"url":"https://github.com/niksy/querypoint","last_synced_at":"2026-04-11T05:03:28.572Z","repository":{"id":24697818,"uuid":"28109170","full_name":"niksy/querypoint","owner":"niksy","description":"Media query breakpoints manager.","archived":false,"fork":false,"pushed_at":"2017-04-20T13:23:03.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T06:49:51.295Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niksy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-16T22:15:42.000Z","updated_at":"2017-04-20T13:19:44.000Z","dependencies_parsed_at":"2022-07-25T11:17:54.912Z","dependency_job_id":null,"html_url":"https://github.com/niksy/querypoint","commit_stats":null,"previous_names":["niksy/kist-querypoint"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niksy%2Fquerypoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niksy%2Fquerypoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niksy%2Fquerypoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niksy%2Fquerypoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niksy","download_url":"https://codeload.github.com/niksy/querypoint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239394191,"owners_count":19631116,"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-11T01:03:10.429Z","updated_at":"2025-11-12T16:30:15.790Z","avatar_url":"https://github.com/niksy.png","language":"JavaScript","readme":"# querypoint\n\n[![Build Status][ci-img]][ci] [![BrowserStack Status][browserstack-img]][browserstack]\n\nMedia query breakpoints manager.\n\nFeatures:\n\n* Named breakpoints for easier organization\n* Initial call when adding listener instead of native behavior (called on first media query event)\n\n## Install\n\n```sh\nnpm install querypoint --save\n```\n\n## Usage\n\n```js\nconst querypoint = require('querypoint');\nconst qp = querypoint();\n\nconst listener = ( mq ) =\u003e {\n\tif ( mq.matches ) {\n\t\t// Matched!\n\t}\n};\n\nqp.add('bp-alpha-s', 'screen and (min-width: 600px)');\nqp.add('bp-alpha-m', window.matchMedia('screen and (min-width: 800px)'));\n\nqp.get('bp-alpha-s').addListener(listener);\n// Subsequent same listener will be registered only once\nqp.get('bp-alpha-s').addListener(listener);\n\n// Remove single listener…\nqp.get('bp-alpha-s').removeListener(listener);\n// …or all registered listeners\nqp.get('bp-alpha-s').removeAllListeners();\n\n// Remove named breakpoint and all registered listeners\nqp.remove('bp-alpha-s');\n```\n\n## API\n\n### querypoint()\n\nReturns: `BreakpointManager`\n\nReturns instance of breakpoint manager.\n\n### qp.add(breakpointName, mq)\n\nReturns: `Breakpoint`\n\nAdd breakpoint to breakpoint manager instance.\n\n#### breakpointName\n\nType: `String`\n\n####  mq\n\nType: `String|MediaQueryList`\n\nValid [media query string][media-query-string] or instance of [`window.matchMedia`][match-media].\n\n### qp.remove(breakpointName)\n\nReturns: `BreakpointManager`\n\nRemove breakpoint from breakpoint manager instance.\n\n#### breakpointName\n\nType: `String`\n\n### qp.get(breakpointName)\n\nReturns: `Breakpoint`\n\nReturns [registered breakpoint](#registered-breakpoint) in breakpoint manager instance.\n\n#### breakpointName\n\nType: `String`\n\n\u003ca name=\"registered-breakpoint\"\u003e\u003c/a\u003e\n\n### breakpoint.addListener(cb)\n\nAdd listener to breakpoint.\n\n#### cb\n\nType: `Function`\n\n### breakpoint.removeListener(cb)\n\nRemove listener from breakpoint.\n\n#### cb\n\nType: `Function`\n\n### breakpoint.removeAllListeners()\n\nRemove all registered listeners from breakpoint.\n\n## Test\n\nFor local automated tests, run `npm run test:automated:local`.\n\nFor manual tests, run `npm run test:manual:local` and open \u003chttp://localhost:9000/\u003e in your browser.\n\n## Browser support\n\nTested in IE9+ and all modern browsers. For proper `window.matchMedia` support in IE9 you should use [polyfill](https://github.com/paulirish/matchMedia.js/).\n\n## License\n\nMIT © [Ivan Nikolić](http://ivannikolic.com)\n\n[ci]: https://travis-ci.org/niksy/querypoint\n[ci-img]: https://travis-ci.org/niksy/querypoint.svg?branch=master\n[browserstack]: https://www.browserstack.com/\n[browserstack-img]: https://www.browserstack.com/automate/badge.svg?badge_key=MHRpV0FMc0g5OEVEQXhDak1DRllDeFZxYnZOZitlR29ick5KaGRheEFXUT0tLWRkaXhrd21ZdGZHOElqMzExR1JObFE9PQ==--8d812569887b861e3e899a08c7bddca522ebe54f\n[media-query-string]: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries\n[match-media]: https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniksy%2Fquerypoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniksy%2Fquerypoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniksy%2Fquerypoint/lists"}