{"_id":"detect-pointer","_rev":"9-4b800ab35f3fad8d40d93a87a51ca4c7","name":"detect-pointer","description":"JavaScript wrapper for pointer and any-pointer media queries","dist-tags":{"latest":"1.0.3"},"versions":{"0.1.0":{"name":"detect-pointer","version":"0.1.0","description":"JavaScript wrapper for pointer and any-pointer media queries","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-pointer.git"},"keywords":["media query","pointer","any-pointer"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-pointer/issues"},"homepage":"https://github.com/rafrex/detect-pointer#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"6966cc76a03bdef27beb216069adabaa3545f2f1","_id":"detect-pointer@0.1.0","_shasum":"2041aaa87db9fd79c147abbab0d2519b6c769b68","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"2041aaa87db9fd79c147abbab0d2519b6c769b68","tarball":"https://registry.npmjs.org/detect-pointer/-/detect-pointer-0.1.0.tgz","integrity":"sha512-M20iKzQieMVEf7I6Hi2djDTqosS4S9aXkIFBqqcLGk8K/5bUyliPPCR7i4VcnDRQAEvbyShRNxM0KCJK/gcJDA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE6z6eiWwGSVdAwvPtnFzK6OuA6dPENx1dulOOmkRYuYAiAF6PxIVOaFc2pxN2rj1HzIuGrRRBOeVSqyT+LtXRRDyw=="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/detect-pointer-0.1.0.tgz_1467781402541_0.5874158046208322"},"directories":{}},"0.1.1":{"name":"detect-pointer","version":"0.1.1","description":"JavaScript wrapper for pointer and any-pointer media queries","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-pointer.git"},"keywords":["media query","pointer","any-pointer"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-pointer/issues"},"homepage":"https://github.com/rafrex/detect-pointer#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"4c65a4e89b49ae4b68dfbaf566c23cbe1dc7823c","_id":"detect-pointer@0.1.1","_shasum":"b5b8e8548f7319277fda0f3b80e0fb6bc32a0747","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"b5b8e8548f7319277fda0f3b80e0fb6bc32a0747","tarball":"https://registry.npmjs.org/detect-pointer/-/detect-pointer-0.1.1.tgz","integrity":"sha512-RMeWJViM5i6uDPsPolJij0tOvthAzgz04nMVDm7BPr7iSBijmMFGcXKucX2YLFlAD8HUpMydqEkz5Ek6KOu7+w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwNKjnSZ8NIyksfAK1SjrIoA/3kW7pOFcUjtXnNdw6PQIhAPcpPn06XFaBRGTxwcw4ybVISYVFUzEBA+kocF1KS0s7"}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/detect-pointer-0.1.1.tgz_1467951563818_0.1704314632806927"},"directories":{}},"1.0.0":{"name":"detect-pointer","version":"1.0.0","description":"JavaScript wrapper for pointer and any-pointer media queries","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-pointer.git"},"keywords":["detect","pointer","any-pointer","media query"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-pointer/issues"},"homepage":"https://github.com/rafrex/detect-pointer#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"65371bc5fefd2944ba2ede96df0fd4c1c9df27bd","_id":"detect-pointer@1.0.0","_shasum":"20f6b422595109e526327f0262707f4271eafdd8","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.0","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"20f6b422595109e526327f0262707f4271eafdd8","tarball":"https://registry.npmjs.org/detect-pointer/-/detect-pointer-1.0.0.tgz","integrity":"sha512-jGYY2YRMFBq/159U+sAh6Z2qPpypqeyrA4gh2MGDQskCu17nJidgJs/24uMlNdYbFphky3Rztq2CHwQnsqM7OQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDUxNJp1kLNAhYJ1e3wYOWvCuW3nxLOuhDfHiGzEW7o6AiEA4M7Cz4AkJU9Dmpjc1OXjbDS1OyT9xLXJXRVMTg6nBDA="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/detect-pointer-1.0.0.tgz_1469142131720_0.42913550115190446"},"directories":{}},"1.0.1":{"name":"detect-pointer","version":"1.0.1","description":"JavaScript wrapper for pointer and any-pointer media queries","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-pointer.git"},"keywords":["detect","pointer","any-pointer","media query"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-pointer/issues"},"homepage":"https://github.com/rafrex/detect-pointer#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"64e2d8cb5493aea572a4101545c047f2a500c4f5","_id":"detect-pointer@1.0.1","_shasum":"cc9aa88b2b0f780250e50a81cfefa9393b14369f","_from":".","_npmVersion":"4.2.0","_nodeVersion":"6.9.5","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"cc9aa88b2b0f780250e50a81cfefa9393b14369f","tarball":"https://registry.npmjs.org/detect-pointer/-/detect-pointer-1.0.1.tgz","integrity":"sha512-9jzlM4OmqjEbFYpmgKHzoehAhCkS1M0NzV1ahGB7MfiB116aybr9/cijn1zlzSZibls656glOaDC79jnqRwDxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxgHrrBRE5blDPRw54GiSuCAqj5t2ttoVmqaFrdUBBEQIgdt4USvWnaxVX4+ZsStESiIxRkXuN5om71keUz6FBopM="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/detect-pointer-1.0.1.tgz_1487964522665_0.03649622993543744"},"directories":{}},"1.0.2":{"name":"detect-pointer","version":"1.0.2","description":"JavaScript wrapper for pointer and any-pointer media queries","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/rafrex/detect-pointer.git"},"keywords":["detect","pointer","any-pointer","media query"],"author":{"name":"Rafael Pedicini","email":"code@rafrex.com"},"license":"MIT","bugs":{"url":"https://github.com/rafrex/detect-pointer/issues"},"homepage":"https://github.com/rafrex/detect-pointer#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"9866e8c595409dd6bdb545ea9542391897c4e562","_id":"detect-pointer@1.0.2","_shasum":"1e0e4e261dab45055c50c74fb5a4ff09ceb18fbd","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"rafrex","email":"code@rafrex.com"},"dist":{"shasum":"1e0e4e261dab45055c50c74fb5a4ff09ceb18fbd","tarball":"https://registry.npmjs.org/detect-pointer/-/detect-pointer-1.0.2.tgz","integrity":"sha512-KP1PzlKxtLvTgR0AvIqV7UU//Ue5CzFShVlLS4/ZZt0VpJBcW8CZliClicnDcLIixm0hohulcZvFdHZfl46ZOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEYJgtkW0T5ztSOvfB0lFYlw99PaSTxHWp7qcFtUCJcMAiBl1uyVl1NQYstx/4bT89u1GYCi61vGmSQ76D33GJpvDg=="}]},"maintainers":[{"name":"rafrex","email":"code@rafrex.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-pointer-1.0.2.tgz_1506364991655_0.13543963595293462"},"directories":{}},"1.0.3":{"name":"detect-pointer","version":"1.0.3","description":"JavaScript wrapper for pointer and any-pointer media queries","main":"lib/index.js","scripts":{"build":"rm -rf lib && babel src --presets babel-preset-es2015 -d lib","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/rafgraph/detect-pointer.git"},"keywords":["detect","pointer","any-pointer","media query"],"author":{"name":"Rafael Pedicini","email":"rafael@rafgraph.dev"},"license":"MIT","bugs":{"url":"https://github.com/rafgraph/detect-pointer/issues"},"homepage":"https://github.com/rafgraph/detect-pointer#readme","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","eslint":"^3.0.1","eslint-config-airbnb-base":"^4.0.0","eslint-plugin-import":"^1.10.2"},"gitHead":"17cd00136c1bfdb7e6ae5fcc4d54321c55a2db6c","_id":"detect-pointer@1.0.3","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-d0o/Puo3fiGSCXy6H039h9Kwz+mmYCGKZ/qtPFnpN3WfsumjC1C9b5KKvRu+aYnfdI8peqN/iAe7dPd85qIt2g==","shasum":"27d86d0837951e6c5a0785c8a7fddd9cf5754e08","tarball":"https://registry.npmjs.org/detect-pointer/-/detect-pointer-1.0.3.tgz","fileCount":5,"unpackedSize":7093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWm3XCRA9TVsSAnZWagAArD4QAInIQV3EyEOSNx3AoFIH\nq0OpcJcQzQCHwjui8642K/M6dsUjhQRNLRdHKRRve4xxmVHYaHFtcjerT+Lm\nzDWtY72BGyjl9H2ErvTg8w7V8RVLYlAHddfaCBj+nuxjMINggOFGuIJCH+Jz\nLqQj9RithSboJU4/gRwkK/LpFD6z7PrzUEQsCX2ou4MMnSl2+G4aYyroGNPz\n0VIy/ui4BoGR3A2B2cL29c0vuT45mJgEq7xvlctbHmkOmcYIWqdpQBXRf532\nLN520HOMS0ngoM9awsjonDdJ7JwT/Olf8Xub7dkUVVOINKr8rmyBypaSAsNS\nAn2HCGVLIsu8AcfKbLkT5+GqPVuvUQRQ4W0WYlKW2KxcYJiVBGs0HbcstWmz\nJoDvm4fZH2Y349aFOdNevM2HIR9sYgOx8arrNmkmL6Z0cp/P8RGfUlp4xvDC\nckRgWT9aMzSgsJJUl9MSMkjLLuy23ZKV2bz7gogPrMtBLGHVPJizoY+P9pXB\n4GsVAVrGv7xTWQWpVCUJcFlgpREVEwiP5YCfTvK2rOx5DbsSQlw1sD/wP9uc\nMnTvhUe/oCKsUcih9UunX6eiZo2oWdPDB6LAj2JMVXPBFeKoynnFJDCGZywx\nNM1/AcqUWdAHNutwUueV1FVL472XR4Of6Bf3H9bxWncpL2cSxiFgD7oFw2jk\n5zmh\r\n=teIh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEiwYcFbhJfhvMGybiHjz8X7FOb8SrTageY+Fx4ZbgXJAiB+bnC82tekzS44lrVAEzRn3oWXie4fQvgLhyIobh7JBg=="}]},"maintainers":[{"name":"rafgraph","email":"rafael@rafgraph.dev"}],"_npmUser":{"name":"rafgraph","email":"rafael@rafgraph.dev"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-pointer_1.0.3_1599761878933_0.2652656083198228"},"_hasShrinkwrap":false}},"readme":"# Detect Pointer\n\nJavaScript wrapper for `pointer` and `any-pointer` media queries.\n\n[Live detection test][liveDetectionTest]\n\nExports a reference to a singleton object (a micro state machine with an update function) with its state set to the results of the `pointer` and `any-pointer` media queries, as well as an `update()` function which re-runs the tests and updates the object's state.\n\nNote that `detect-pointer` is one of the micro state machines used by [`detect-it`][detectItRepo] to determine if a device is `mouseOnly`, `touchOnly`, or `hybrid`.\n\n*For more information on the `pointer` and `any-pointer` media queries, please see the [W3C Media Queries Level 4 specification][w3cSpecLatest]. For information on browser compatibility, please see [Can I Use matchMedia][canIUseMatchMedia].*\n\n\n### `detectPointer` micro state machine\n```javascript\nconst detectPointer = {\n  // mutually exclusive (only one will be true)\n  fine: boolean,\n  coarse: boolean,\n  none: boolean,\n\n  // not mutually exclusive\n  anyFine: boolean,\n  anyCoarse: boolean,\n  anyNone: boolean,\n\n  // re-run all the detection tests and update state\n  update() {...},\n}\n```\n\n### Installing `detect-pointer`\n```terminal\n$ npm install detect-pointer\n```\n\n### Using `detect-pointer`\n```javascript\nimport detectPointer from 'detect-pointer';\n```\n```javascript\n// using the state\ndetectPointer.fine === true; // primary pointing device is accurate (e.g. mouse, stylus)\ndetectPointer.coarse === true; // primary pointing device has limited accuracy (e.g. touch, motion)\ndetectPointer.none === true; // primary input mechanism does not include a pointing device\n\n/*\n * identical to the pointer media feature, but they correspond to the\n * union of capabilities of all the pointing devices available to the user -\n * more than one of their values can be true, if different input mechanisms have\n * different characteristics\n */\ndetectPointer.anyFine === true;\ndetectPointer.anyCoarse === true;\ndetectPointer.anyNone === true;\n\n\n// updating the state - most apps won't need to use this at all\ndetectPointer.update();\n```\n\n```javascript\n/*\n * note that in the case of a legacy computer and browser, one that\n * doesn't support detect-pointer's detection tests, the default state will be:\n */\nconst detectPointer = {\n  fine: undefined,\n  coarse: undefined,\n  none: undefined,\n  anyFine: undefined,\n  anyCoarse: undefined,\n  anyNone: undefined,\n}\n```\n\nNote that the `update()` function is run once at the time of import to set the object's initial state, and generally doesn't need to be run again. If it doesn't have access to the `window` or the browser doesn't support the `matchMedia()` function (all modern browser do), then the state will be `undefined` (`detect-pointer` will not throw an error). If `detect-pointer` doesn't have access to the `window` at the time of import, you will have to call the `update()` function manually at a later time to update its state.\n\n### Part of the [`detect-it`][detectItRepo] family\n- [`detect-it`][detectItRepo]\n  - [`detect-hover`][detectHoverRepo]\n  - **`detect-pointer`**\n  - [`detect-touch-events`][detectTouchEventsRepo]\n  - [`detect-passive-events`][detectPassiveEventsRepo]\n\n\n<!-- links -->\n[liveDetectionTest]: https://detect-it.rafgraph.dev/#detect-pointer\n[w3cSpecLatest]: https://www.w3.org/TR/mediaqueries-4/#pointer\n[canIUseMatchMedia]: https://caniuse.com/#feat=matchmedia\n[detectItRepo]: https://github.com/rafgraph/detect-it\n[detectHoverRepo]: https://github.com/rafgraph/detect-hover\n[detectTouchEventsRepo]: https://github.com/rafgraph/detect-touch-events\n[detectPassiveEventsRepo]: https://github.com/rafgraph/detect-passive-events\n","maintainers":[{"name":"rafgraph","email":"rafael@rafgraph.dev"}],"time":{"modified":"2022-06-15T01:58:06.986Z","created":"2016-07-06T05:03:24.868Z","0.1.0":"2016-07-06T05:03:24.868Z","0.1.1":"2016-07-08T04:19:25.061Z","1.0.0":"2016-07-21T23:02:14.682Z","1.0.1":"2017-02-24T19:28:43.230Z","1.0.2":"2017-09-25T18:43:12.691Z","1.0.3":"2020-09-10T18:17:59.303Z"},"homepage":"https://github.com/rafgraph/detect-pointer#readme","keywords":["detect","pointer","any-pointer","media query"],"repository":{"type":"git","url":"git+https://github.com/rafgraph/detect-pointer.git"},"author":{"name":"Rafael Pedicini","email":"rafael@rafgraph.dev"},"bugs":{"url":"https://github.com/rafgraph/detect-pointer/issues"},"license":"MIT","readmeFilename":"README.md"}