{"name":"mousetrap","version":"1.6.2","description":"Simple library for handling keyboard shortcuts","main":"mousetrap.js","directories":{"test":"tests"},"scripts":{"test":"grunt mocha"},"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":{"grunt":"~0.4.1","grunt-complexity":"~0.1.2","grunt-mocha":"~0.3.1"},"bugs":{"url":"https://github.com/ccampbell/mousetrap/issues"},"homepage":"https://github.com/ccampbell/mousetrap#readme","_id":"mousetrap@1.6.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},"dist":{"integrity":"sha512-jDjhi7wlHwdO6q6DS7YRmSHcuI+RVxadBkLt3KHrhd3C2b+w5pKefg3oj5beTcHZyVFA9Aksf+yEE1y5jxUjVA==","shasum":"caadd9cf886db0986fb2fee59a82f6bd37527587","tarball":"http://registry-npm.ywwl.com/mousetrap/download/mousetrap-1.6.2.tgz","fileCount":32,"unpackedSize":557088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEpkCCRA9TVsSAnZWagAAv2gP/j4ybSR+4NxEBvRVWbMN\nj6UiUzJj1cpexIpB/I5XoQBNvx3snA9pRqZupadyLhDHDJsRO2lN2mQKZ0nA\n/yx3GgKIo2G9Uvt5wSVPTlKM9G8/xFkRqcdiaGevVt4u8hK8xy4QK0265c8h\nFvjxqncCV6Gwr7ceESh9iTlJSckQx92vtZsZIpyu+cDX8RxMweqMsvHoPW+V\n/ZVvVWeJzX4bdgg5xRWXWw2oe2uGz7tKyUXCnRQQWFN7S0uI76oHmvn9ICeI\nPU0zUOB2/KLZ6BXQazIiWRl48VDNooMPlwMPWYuqWGc/xLMBV0WA4hsfbeII\ng6BOTsCkj4t417PTFlihETeUZAOtJkJxIoys5UZwljZ9NICJNJFC8NRECXeF\nzr6v58VkNeKnivdlgsbfXHS468eiJyeiupCtII82Jo7o7GT7SCYEfWjjiNew\nd6ARq6F6wBdJyojeudikxsRI14OA3RrG2VDSaToo9mCsjuB2kTiwMWB6L9kg\niquIo6XdVAcKUQDiaK3hr1/S3Q2ijkVGTljMK8XavNfaZ2bRbm9SDHXNZ0yv\n4kIJj5Uq/8pSnekGi2GZpMxqcNYmOy+kkUoxSBCQBc3Vp3Y/M8AUSsdpYt2e\n1EhnzWNQ3vIO89jPMFdSLz3XZXODT/kFuzvChyZOfp0UsZvHBAQeFhfEKKRr\ng8Ks\r\n=UjA7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF841pY179HGuJfHzwX6s4UPIhxXq0F8j6krYQKN8ALUAiEAnblOTVEafO5j8KWBWNI5w5RbBHhpheRvCb6cdUt0vOw="}],"size":134640,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.6.2.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.2_1527945473949_0.4903941016928657"},"_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":1527945474035,"_cnpm_publish_time":1527945474035,"dist-tags":{"latest":"1.6.5"}}