{"_id":"mousetrap","_rev":"331407","name":"mousetrap","description":"Simple library for handling keyboard shortcuts","dist-tags":{"latest":"1.6.5"},"maintainers":[{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},{"name":"zeke","email":"zeke@sikelianos.com"}],"time":{"modified":"2021-06-07T02:46:51.000Z","created":"2012-08-01T18:02:17.353Z","1.6.5":"2020-01-23T21:49:23.893Z","1.6.4":"2020-01-23T15:32:27.773Z","1.6.3":"2019-03-04T17:14:03.064Z","1.6.2":"2018-06-02T13:17:54.035Z","1.6.1":"2017-04-02T19:46:10.953Z","1.6.0":"2016-05-29T13:28:21.262Z","1.5.3":"2015-07-02T20:36:37.767Z","1.5.2":"2015-03-30T14:58:17.247Z","1.5.1":"2015-03-30T06:01:24.990Z","1.4.6":"2014-11-14T19:48:05.726Z","0.0.1":"2012-08-01T18:02:17.353Z"},"users":{"zeke":true,"fgribreau":true,"shahor":true,"benji.":true,"gabrielsanterre":true,"plitat":true,"shanewholloway":true,"0x4c3p":true,"aitorllj93":true,"trevorllarson":true,"j.su":true,"timdp":true,"tommyzzm":true,"3846masa":true,"zapo":true,"koalaylj":true,"onbing":true,"filipve":true,"mrmartineau":true,"ungurys":true,"lestad":true,"fabien0102":true,"1two3code":true,"larrychen":true,"papasavva":true,"kontrax":true,"raojs":true,"heineiuo":true,"itcorp":true,"hccdj131":true,"zalithka":true,"simonfan":true,"tpkn":true,"spmsupun":true,"zhenguo.zhao":true,"xfloops":true},"author":{"name":"Craig Campbell"},"repository":{"type":"git","url":"git://github.com/ccampbell/mousetrap.git"},"versions":{"1.6.5":{"name":"mousetrap","version":"1.6.5","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.5","_npmVersion":"6.5.0","_nodeVersion":"11.9.0","_npmUser":{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},"dist":{"shasum":"8a766d8c272b08393d5f56074e0b5ec183485bf9","size":60334,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.6.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/mousetrap/download/mousetrap-1.6.5.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.5_1579816163768_0.9118449434645535"},"_hasShrinkwrap":false,"publish_time":1579816163893,"_cnpm_publish_time":1579816163893},"1.6.4":{"name":"mousetrap","version":"1.6.4","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.4","_npmVersion":"6.5.0","_nodeVersion":"11.9.0","_npmUser":{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},"dist":{"shasum":"6a65d9ef6b5dcfbe98f88eaa95110dfe0674dec6","size":60317,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.6.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/mousetrap/download/mousetrap-1.6.4.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.4_1579793547610_0.01641635393307661"},"_hasShrinkwrap":false,"publish_time":1579793547773,"_cnpm_publish_time":1579793547773},"1.6.3":{"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":{"shasum":"80fee49665fd478bccf072c9d46bdf1bfed3558a","size":60302,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.6.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/mousetrap/download/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,"publish_time":1551719643064,"_cnpm_publish_time":1551719643064},"1.6.2":{"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":{"shasum":"caadd9cf886db0986fb2fee59a82f6bd37527587","size":134640,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.6.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/mousetrap/download/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,"publish_time":1527945474035,"_cnpm_publish_time":1527945474035},"1.6.1":{"name":"mousetrap","version":"1.6.1","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#readme","_id":"mousetrap@1.6.1","_shasum":"2a085f5c751294c75e7e81f6ec2545b29cbf42d9","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.3.0","_npmUser":{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},"dist":{"shasum":"2a085f5c751294c75e7e81f6ec2545b29cbf42d9","size":134348,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.6.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/mousetrap/download/mousetrap-1.6.1.tgz"},"maintainers":[{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},{"name":"zeke","email":"zeke@sikelianos.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/mousetrap-1.6.1.tgz_1491162370110_0.5341132220346481"},"publish_time":1491162370953,"_cnpm_publish_time":1491162370953,"_hasShrinkwrap":false},"1.6.0":{"name":"mousetrap","version":"1.6.0","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#readme","_id":"mousetrap@1.6.0","_shasum":"0168fcabb11d07669e87490324c981208121ac4d","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.7.0","_npmUser":{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},"maintainers":[{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},{"name":"zeke","email":"zeke@sikelianos.com"}],"dist":{"shasum":"0168fcabb11d07669e87490324c981208121ac4d","size":134190,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.6.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mousetrap/download/mousetrap-1.6.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/mousetrap-1.6.0.tgz_1464528499182_0.441110307816416"},"publish_time":1464528501262,"_cnpm_publish_time":1464528501262,"_hasShrinkwrap":false},"1.5.3":{"name":"mousetrap","version":"1.5.3","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.5.3","dist":{"shasum":"33a900b15184427c4f583e9d9822ee6c3eaf265b","size":130664,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.5.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/mousetrap/download/mousetrap-1.5.3.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},"maintainers":[{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},{"name":"zeke","email":"zeke@sikelianos.com"}],"publish_time":1435869397767,"_cnpm_publish_time":1435869397767,"_hasShrinkwrap":false},"1.5.2":{"name":"mousetrap","version":"1.5.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","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.5.2","dist":{"shasum":"35b2a68dc29b65365078d78593643ee23054f9b7","size":130644,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.5.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/mousetrap/download/mousetrap-1.5.2.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},"maintainers":[{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},{"name":"zeke","email":"zeke@sikelianos.com"}],"publish_time":1427727497247,"_cnpm_publish_time":1427727497247,"_hasShrinkwrap":false},"1.5.1":{"name":"mousetrap","version":"1.5.1","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.5.1","dist":{"shasum":"6790deb7bcef8d89c641a25c8355bea2c8173732","size":130627,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.5.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/mousetrap/download/mousetrap-1.5.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},"maintainers":[{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},{"name":"zeke","email":"zeke@sikelianos.com"}],"publish_time":1427695284990,"_cnpm_publish_time":1427695284990,"_hasShrinkwrap":false},"1.4.6":{"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":"ccampbell","email":"iamcraigcampbell@gmail.com"},{"name":"zeke","email":"zeke@sikelianos.com"}],"dist":{"shasum":"eaca72e22e56d5b769b7555873b688c3332e390a","size":129152,"noattachment":false,"key":"/mousetrap/-/mousetrap-1.4.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/mousetrap/download/mousetrap-1.4.6.tgz"},"publish_time":1415994485726,"_cnpm_publish_time":1415994485726,"_hasShrinkwrap":false},"0.0.1":{"name":"mousetrap","version":"0.0.1","description":"Keyboard shortcuts component (browser)","main":"mousetrap.js","repository":{"type":"git","url":"git://github.com/component/mousetrap.git"},"keywords":["keyboard","component","shortcuts"],"component":{"scripts":{"mousetrap":"mousetrap.js"}},"_id":"mousetrap@0.0.1","dist":{"shasum":"7d3ef6ecfa00761054fe36bda68d0f6cea16058b","size":45068,"noattachment":false,"key":"/mousetrap/-/mousetrap-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/mousetrap/download/mousetrap-0.0.1.tgz"},"maintainers":[{"name":"ccampbell","email":"iamcraigcampbell@gmail.com"},{"name":"zeke","email":"zeke@sikelianos.com"}],"directories":{},"publish_time":1343844137353,"_cnpm_publish_time":1343844137353,"_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","_attachments":{},"homepage":"https://github.com/ccampbell/mousetrap#readme","bugs":{"url":"https://github.com/ccampbell/mousetrap/issues"},"license":"Apache-2.0 WITH LLVM-exception"}