{"name":"mousetrap","version":"1.6.3","description":"Simple library for handling keyboard shortcuts","main":"mousetrap.js","directories":{"test":"tests"},"scripts":{"test":"mocha --reporter=nyan tests/test.mousetrap.js"},"repository":{"type":"git","url":"git://github.com/ccampbell/mousetrap.git"},"keywords":["keyboard","shortcuts","events"],"author":{"name":"Craig Campbell"},"license":"Apache-2.0 WITH LLVM-exception","gitHead":"c202a0bd4967d5a3064f9cb376db51dec9345336","devDependencies":{"chai":"^4.2.0","grunt":"~1.0.3","grunt-complexity":"~1.1.0","jsdom":"^13.1.0","jsdom-global":"^3.0.2","mocha":"^5.2.0","sinon":"^7.2.2"},"bugs":{"url":"https://github.com/ccampbell/mousetrap/issues"},"homepage":"https://github.com/ccampbell/mousetrap#readme","_id":"mousetrap@1.6.3","_npmVersion":"6.5.0","_nodeVersion":"11.9.0","_npmUser":{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},"dist":{"integrity":"sha512-bd+nzwhhs9ifsUrC2tWaSgm24/oo2c83zaRyZQF06hYA6sANfsXHtnZ19AbbbDXCDzeH5nZBSQ4NvCjgD62tJA==","shasum":"80fee49665fd478bccf072c9d46bdf1bfed3558a","tarball":"http://registry-npm.ywwl.com/mousetrap/download/mousetrap-1.6.3.tgz","fileCount":27,"unpackedSize":195837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfVzbCRA9TVsSAnZWagAApOsP/0PpVrQ2QjWlwJBBptrK\niUOz/tU8U8diPEnUaUtGQE3Q4Dp/fqUslMovnQVeWkNLDM04bI4zuKiZbF9u\nOivGeWFsEqETV/D/Yfa1ueJxRWLLLtLpT7xLOmf9pO28gycHaJT7Nm0ztG6j\n13SstfcI6ljd97inCa2Hum4dk4dgiVM4O6g2sZKswZ3UWgRIc57rfU1mLuug\n9KJs3JzyeNaClpijipOXr7bUYCOTGPzLSK4kPLJeD+weRHhpZ5g/hvRqye0n\nYUbhn15LsFanypjLlNK8bO8ovW0xVsncJr2fWqGCpZywZtuW4MslfG0oCdF2\npkAqEAn1230LGqSdO7+4e9OJpYuXAkQ443w9ufErfLJXrYTf/QfGlZDl6bbW\n90jgaiWg3QE+9pj8iLR5bMXzGk1G7DWCsIfq3S3H8bIW7DvoN+HVGoO8Iq9g\nk3mDPm7+Rp2GlsmCYv7SV45rYEHBlebA/DwNDG0JpNUfpnFKOGCUn39sIXhb\n35eprymXjdXxAhGDjjkcs3fhYSW1SUoJTDp+bRs/sdgPq6wjhXckaKJ3z1KF\n7TG6Rz7DyMYJNHJRwa2aHRx0UeHap963osdFZjoY4Oe3r147VVwuRH9bPs/h\n5Dl2tSEvTQHqKpAIbZnXzbszjTzp13HbnJwdNEuW17NL46Gn4rLXyeghQi9n\ntz6X\r\n=lFBt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHLiSl3RTCKx8fGKoMhtoaZH6MCCgCTbqO9BVQKm6ze3AiAzeKomXYFR2memq4BKPlYnarXWkOP0o86etCqDb90xjA=="}],"size":60302,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.6.3.tgz"},"maintainers":[{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},{"name":"zeke","email":"zeke@sikelianos.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mousetrap_1.6.3_1551719642929_0.6708555043934634"},"_hasShrinkwrap":false,"readme":"# Mousetrap\n[![CDNJS](https://img.shields.io/cdnjs/v/mousetrap.svg)](https://cdnjs.com/libraries/mousetrap)\n\nMousetrap is a simple library for handling keyboard shortcuts in Javascript.\n\nIt is licensed under the Apache 2.0 license.\n\nIt is around **2kb** minified and gzipped and **4.5kb** minified, has no external dependencies, and has been tested in the following browsers:\n\n- Internet Explorer 6+\n- Safari\n- Firefox\n- Chrome\n\nIt has support for `keypress`, `keydown`, and `keyup` events on specific keys, keyboard combinations, or key sequences.\n\n## Getting started\n\n1. Include mousetrap on your page before the closing `</body>` tag\n\n    ```html\n    <script src=\"/path/to/mousetrap.min.js\"></script>\n    ```\n\n    or install `mousetrap` from `npm` and require it\n\n    ```js\n    var Mousetrap = require('mousetrap');\n    ```\n\n2. Add some keyboard events to listen for\n\n    ```html\n    <script>\n        // single keys\n        Mousetrap.bind('4', function() { console.log('4'); });\n        Mousetrap.bind(\"?\", function() { console.log('show shortcuts!'); });\n        Mousetrap.bind('esc', function() { console.log('escape'); }, 'keyup');\n\n        // combinations\n        Mousetrap.bind('command+shift+k', function() { console.log('command shift k'); });\n\n        // map multiple combinations to the same callback\n        Mousetrap.bind(['command+k', 'ctrl+k'], function() {\n            console.log('command k or control k');\n\n            // return false to prevent default browser behavior\n            // and stop event from bubbling\n            return false;\n        });\n\n        // gmail style sequences\n        Mousetrap.bind('g i', function() { console.log('go to inbox'); });\n        Mousetrap.bind('* a', function() { console.log('select all'); });\n\n        // konami code!\n        Mousetrap.bind('up up down down left right left right b a enter', function() {\n            console.log('konami code');\n        });\n    </script>\n    ```\n\n## Why Mousetrap?\n\nThere are a number of other similar libraries out there so what makes this one different?\n\n- There are no external dependencies, no framework is required\n- You are not limited to `keydown` events (You can specify `keypress`, `keydown`, or `keyup` or let Mousetrap choose for you).\n- You can bind key events directly to special keys such as `?` or `*` without having to specify `shift+/` or `shift+8` which are not consistent across all keyboards\n- It works with international keyboard layouts\n- You can bind Gmail like key sequences in addition to regular keys and key combinations\n- You can programatically trigger key events with the `trigger()` method\n- It works with the numeric keypad on your keyboard\n- The code is well documented/commented\n\n## Tests\n\nUnit tests are run with <a href=\"https://mochajs.org/\">mocha</a>.\n\n### Running in browser\n\n[View it online](http://rawgit.com/ccampbell/mousetrap/master/tests/mousetrap.html) to check your browser compatibility. You may also download the repo and open `tests/mousetrap.html` in your browser.\n\n### Running with Node.js\n\n1. Install development dependencies\n\n    ```sh\n    cd /path/to/repo\n    npm install\n    ```\n\n3. Run tests\n\n    ```sh\n    npm test\n    ```\n\n## Documentation\n\nFull documentation can be found at https://craig.is/killing/mice\n","publish_time":1551719643064,"_cnpm_publish_time":1551719643064,"dist-tags":{"latest":"1.6.5"}}