{"name":"mousetrap","version":"1.4.6","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","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","_id":"mousetrap@1.4.6","_shasum":"eaca72e22e56d5b769b7555873b688c3332e390a","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.31","_npmUser":{"name":"zeke","email":"zeke@sikelianos.com"},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"dominicbarnes","email":"dominic@dbarnes.info"},{"name":"tootallnate","email":"nathan@tootallnate.net"},{"name":"rauchg","email":"rauchg@gmail.com"},{"name":"retrofox","email":"rdsuarez@gmail.com"},{"name":"coreh","email":"thecoreh@gmail.com"},{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},{"name":"kelonye","email":"kelonyemitchel@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"yields","email":"yields@icloud.com"},{"name":"anthonyshort","email":"antshort@gmail.com"},{"name":"ianstormtaylor","email":"ian@ianstormtaylor.com"},{"name":"cristiandouce","email":"cristian@gravityonmars.com"},{"name":"swatinem","email":"arpad.borsos@googlemail.com"},{"name":"stagas","email":"gstagas@gmail.com"},{"name":"amasad","email":"amjad.masad@gmail.com"},{"name":"juliangruber","email":"julian@juliangruber.com"},{"name":"shtylman","email":"shtylman@gmail.com"},{"name":"calvinfo","email":"calvin@calv.info"},{"name":"blakeembrey","email":"hello@blakeembrey.com"},{"name":"timoxley","email":"secoif@gmail.com"},{"name":"jonathanong","email":"jonathanrichardong@gmail.com"},{"name":"queckezz","email":"fabian.eichenberger@gmail.com"},{"name":"nami-doc","email":"vendethiel@hotmail.fr"},{"name":"clintwood","email":"clint@anotherway.co.za"},{"name":"zeke","email":"zeke@sikelianos.com"}],"dist":{"shasum":"eaca72e22e56d5b769b7555873b688c3332e390a","tarball":"http://registry-npm.ywwl.com/mousetrap/download/mousetrap-1.4.6.tgz","integrity":"sha512-7i4YgGN/m6GMJbn2g4pyrKFUNEjWIICmuiywWDzdph8qASzEGk+VB3vQYrnxdBkuMTP4ZE+K92TKeQHL92wZOQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSJRLDAFD4CdpE6I3ic2JA35TGqj0x4iVs//j2lDWnlAIgT539Yh9A0ygggtNUzh5XQ5JIB0Dv2eJP+BJ3tcIn8c0="}],"size":129152,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.4.6.tgz"},"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":1415994485726,"_cnpm_publish_time":1415994485726,"dist-tags":{"latest":"1.6.5"}}