{"maintainers":[{"name":"feix760","email":"382184760@qq.com"},{"name":"otakustay","email":"otakustay@icloud.com"}],"dist-tags":{"latest":"2.3.0"},"description":"A simple and dedicated library to provide event components","readme":"# mini-event\n\nmini-event是一个简单的工具库，用于为任何系统提供事件相关的功能集，包括：\n\n- 统一的`Event`事件对象。\n- 事件的阻止默认行为（`preventDefault`）、停止冒泡（`stopPropagation`）、阻止后续处理（`stopImmediatePropagation`）功能。\n- 事件的注册、反注册等功能。\n\n## 文档\n\n    cd {mini-event}\n    npm i -g esdoc\n    esdoc -c esdoc.json\n    open doc/index.html\n\n## 事件类型\n\n在mini-event模型中，事件共分为2类。\n\n### 命名事件\n\n命名事件是最普通的事件，指一个带有名字的事件。当使用`.fire(eventName)`方法触发事件时，其中的`eventName`指定事件名称，对应名称符合的命名事件将被触发。\n\n### 全局事件\n\n全局事件是名称为`*`的事件，当任何事件被触发时，全局事件均会被触发。\n\n开发者*不能*直接触发全局事件，使用`.fire('*')`触发全局事件将会得到异常结果。\n\n全局事件**一定**在命名事件均触发完毕后触发。\n\n全局事件触发时，事件对象的`type`属性值为事件的原始名称，而非`*`。\n\n## 事件处理函数\n\n不同类型的事件按以下顺序执行：\n\n1. 依次触发所有命名事件处理函数。\n2. 依次触发所有全局事件处理函数。\n\n以上2步中，每一步对应的所有事件处理函数的执行有如下特征：\n\n1. 触发顺序与事件被注册的顺序相同。\n2. 同一个事件处理函数仅会被触发一次。\n3. 在事件触发过程中，如果一个处理函数A移除了同一事件的另一个处理函数B，且B还未触发，则该处理函数不会在本次触发中被执行。\n3. 如果调用事件对象的`.stopImmediatePropagation()`方法，则后续的处理函数均不会被执行。\n\n当一个命名事件触发时，如果处理函数A在执行时移除了全局事件中的处理函数B，则由于B还未被执行，因此后续的全局事件中的处理函数B将不会再被执行。\n\n如果一个事件在命名事件触发时被执行，则其在全局事件被触发时依旧可能被执行。命名事件与全局事件不存在去重的关系。\n\n## 2.0版本变更\n\n1. 使用ES6重写，需要完整的ES6运行环境或者对应的`polyfill`和编译转换，推荐使用[babel](http://babeljs.io/)进行编译。\n2. 移除`Event.fromDOMEvent`方法。\n3. 移除`EventTarget.enable`方法。\n4. 移除对内联事件处理函数（`onxxx`方法）的支持。\n\n## 2.1版本变更\n\n1. 增加了`dist`目录放置使用UMD编译后的代码。\n2. 内部事件池对象不再从`Object.prototype`继承。\n3. 优化了单元测试、文档生成等npm命令。\n\n## 2.2版本变更\n\n1. `main`模块修改为ES6（以前忘记了- -）。\n\n## 2.3版本变更\n\n- 修改了编译方式，现在所有文件会编译至根目录，以便NodeJS环境下使用\n","repository":{"type":"git","url":"git://github.com/%3Aecomfe/mini-event.git"},"bugs":{"url":"https://github.com/ecomfe/mini-event/issues"},"license":"MIT","versions":{"1.0.0":{"name":"mini-event","version":"1.0.0","description":"A simple and dedicated library to provide event components","main":"main","maintainers":[{"name":"feix760","email":"382184760@qq.com"}],"contributors":[{"name":"otakustay","email":"otakustay@gmail.com"}],"license":"MIT","repository":{"type":"git","url":"git://github.com:ecomfe/mini-event.git"},"bugs":{"url":"https://github.com/ecomfe/mini-event/issues"},"homepage":"https://github.com/ecomfe/mini-event","_id":"mini-event@1.0.0","scripts":{},"_shasum":"a07c1b138f7b4494faad9edaf720924d6dfa3bb5","_from":".","_npmVersion":"1.4.20","_npmUser":{"name":"feix760","email":"382184760@qq.com"},"dist":{"shasum":"a07c1b138f7b4494faad9edaf720924d6dfa3bb5","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/mini-event/-/mini-event-1.0.0.tgz"},"directories":{}},"1.0.2":{"name":"mini-event","version":"1.0.2","description":"A simple and dedicated library to provide event components","main":"main","maintainers":[{"name":"feix760","email":"382184760@qq.com"}],"contributors":[{"name":"otakustay","email":"otakustay@gmail.com"}],"license":"MIT","repository":{"type":"git","url":"git://github.com:ecomfe/mini-event.git"},"bugs":{"url":"https://github.com/ecomfe/mini-event/issues"},"gitHead":"6692b84399ee78c13e647d7341d544ca4b046b9d","homepage":"https://github.com/ecomfe/mini-event","_id":"mini-event@1.0.2","scripts":{},"_shasum":"a0ecd2cdc0af184ab5567607fec76a0a96c9cad7","_from":"mini-event","_resolved":"file:mini-event","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"feix760","email":"382184760@qq.com"},"dist":{"shasum":"a0ecd2cdc0af184ab5567607fec76a0a96c9cad7","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/mini-event/-/mini-event-1.0.2.tgz"},"directories":{}},"2.0.0":{"name":"mini-event","version":"2.0.0","description":"A simple and dedicated library to provide event components","main":"main","maintainers":[{"name":"feix760","email":"382184760@qq.com"},{"name":"otakustay","email":"otakustay@icloud.com"}],"contributors":[{"name":"otakustay","email":"otakustay@gmail.com"}],"license":"MIT","repository":{"type":"git","url":"git://github.com/%3Aecomfe/mini-event.git"},"bugs":{"url":"https://github.com/ecomfe/mini-event/issues"},"edp":{"wwwroot":"/","depDir":"dep","srcDir":"src","loaderAutoConfig":"js,htm,html,tpl,vm,phtml","loaderUrl":"http://s1.bdstatic.com/r/www/cache/ecom/esl/1-8-2/esl.js","dependencies":{},"layout":"v2"},"devDependencies":{"babel-core":"^6.3.21","babel-plugin-transform-es2015-modules-umd":"^6.3.13","babel-preset-es2015":"^6.3.13"},"gitHead":"9d268b15516ddd2901becd48fe9cba6b4c9ef5e3","homepage":"https://github.com/%3Aecomfe/mini-event#readme","_id":"mini-event@2.0.0","scripts":{},"_shasum":"4046eaf086db534b2be42c6c1df34c4fcd4db15e","_from":".","_npmVersion":"3.3.12","_nodeVersion":"4.2.3","_npmUser":{"name":"otakustay","email":"otakustay@icloud.com"},"dist":{"shasum":"4046eaf086db534b2be42c6c1df34c4fcd4db15e","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/mini-event/-/mini-event-2.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/mini-event-2.0.0.tgz_1456369359541_0.3193066690582782"},"directories":{}},"2.0.1":{"name":"mini-event","version":"2.0.1","description":"A simple and dedicated library to provide event components","main":"main","maintainers":[{"name":"feix760","email":"382184760@qq.com"},{"name":"otakustay","email":"otakustay@icloud.com"}],"contributors":[{"name":"otakustay","email":"otakustay@gmail.com"}],"license":"MIT","repository":{"type":"git","url":"git://github.com/%3Aecomfe/mini-event.git"},"bugs":{"url":"https://github.com/ecomfe/mini-event/issues"},"edp":{"wwwroot":"/","depDir":"dep","srcDir":"src","loaderAutoConfig":"js,htm,html,tpl,vm,phtml","loaderUrl":"http://s1.bdstatic.com/r/www/cache/ecom/esl/1-8-2/esl.js","dependencies":{},"layout":"v2"},"devDependencies":{"babel-core":"^6.3.21","babel-plugin-transform-es2015-modules-umd":"^6.3.13","babel-preset-es2015":"^6.3.13"},"gitHead":"ceb4c1a7e747528c8dc04abd11f071c8c4b1e259","homepage":"https://github.com/%3Aecomfe/mini-event#readme","_id":"mini-event@2.0.1","scripts":{},"_shasum":"bb2bd0951fe853f7dc9d22b2fef2a7ea3a3c1571","_from":".","_npmVersion":"3.3.12","_nodeVersion":"4.2.3","_npmUser":{"name":"otakustay","email":"otakustay@icloud.com"},"dist":{"shasum":"bb2bd0951fe853f7dc9d22b2fef2a7ea3a3c1571","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/mini-event/-/mini-event-2.0.1.tgz"},"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/mini-event-2.0.1.tgz_1456369383669_0.0458377655595541"},"directories":{}},"2.1.0":{"name":"mini-event","version":"2.1.0","description":"A simple and dedicated library to provide event components","main":"main","maintainers":[{"name":"feix760","email":"382184760@qq.com"},{"name":"otakustay","email":"otakustay@icloud.com"}],"contributors":[{"name":"otakustay","email":"otakustay@gmail.com"}],"license":"MIT","repository":{"type":"git","url":"git://github.com/%3Aecomfe/mini-event.git"},"bugs":{"url":"https://github.com/ecomfe/mini-event/issues"},"scripts":{"test":"edp test start --singleRun","doc":"esdoc -c esdoc.json","compile":"babel -d dist/ src/","prepublish":"npm run compile"},"edp":{"wwwroot":"/","depDir":"dep","srcDir":"src","loaderAutoConfig":"js,htm,html,tpl,vm,phtml","loaderUrl":"http://s1.bdstatic.com/r/www/cache/ecom/esl/1-8-2/esl.js","dependencies":{},"layout":"v2"},"devDependencies":{"babel-cli":"^6.7.7","babel-core":"^6.3.21","babel-plugin-transform-es2015-modules-umd":"^6.6.5","babel-preset-es2015":"^6.3.13","esdoc":"^0.4.4","esdoc-es7-plugin":"0.0.3"},"gitHead":"569f8a292f8e3f0a1a74b71453ded9de63986ec7","homepage":"https://github.com/%3Aecomfe/mini-event#readme","_id":"mini-event@2.1.0","_shasum":"86982eaf8fe68eda2be555110f0f1f6fbb79ead0","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"otakustay","email":"otakustay@icloud.com"},"dist":{"shasum":"86982eaf8fe68eda2be555110f0f1f6fbb79ead0","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/mini-event/-/mini-event-2.1.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/mini-event-2.1.0.tgz_1461903510729_0.5878864396363497"},"directories":{}},"2.2.0":{"name":"mini-event","version":"2.2.0","description":"A simple and dedicated library to provide event components","main":"main","maintainers":[{"name":"feix760","email":"382184760@qq.com"},{"name":"otakustay","email":"otakustay@icloud.com"}],"contributors":[{"name":"otakustay","email":"otakustay@gmail.com"}],"license":"MIT","repository":{"type":"git","url":"git://github.com/%3Aecomfe/mini-event.git"},"bugs":{"url":"https://github.com/ecomfe/mini-event/issues"},"scripts":{"test":"edp test start --singleRun","doc":"esdoc -c esdoc.json","compile":"babel -d dist/ src/","prepublish":"npm run compile"},"edp":{"wwwroot":"/","depDir":"dep","srcDir":"src","loaderAutoConfig":"js,htm,html,tpl,vm,phtml","loaderUrl":"http://s1.bdstatic.com/r/www/cache/ecom/esl/1-8-2/esl.js","dependencies":{},"layout":"v2"},"devDependencies":{"babel-cli":"^6.7.7","babel-core":"^6.3.21","babel-plugin-transform-es2015-modules-umd":"^6.6.5","babel-preset-es2015":"^6.3.13","esdoc":"^0.4.4","esdoc-es7-plugin":"0.0.3"},"gitHead":"daa6cff8510f77f55aec413f450acc7c3249b30d","homepage":"https://github.com/%3Aecomfe/mini-event#readme","_id":"mini-event@2.2.0","_shasum":"24bf59f327e2011754e0ba000d92bbdbd230311c","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"otakustay","email":"otakustay@icloud.com"},"dist":{"shasum":"24bf59f327e2011754e0ba000d92bbdbd230311c","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/mini-event/-/mini-event-2.2.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/mini-event-2.2.0.tgz_1464159316529_0.19057441921904683"},"directories":{}},"2.3.0":{"name":"mini-event","version":"2.3.0","description":"A simple and dedicated library to provide event components","main":"main","maintainers":[{"name":"feix760","email":"382184760@qq.com"},{"name":"otakustay","email":"otakustay@icloud.com"}],"contributors":[{"name":"otakustay","email":"otakustay@gmail.com"}],"license":"MIT","repository":{"type":"git","url":"git://github.com/%3Aecomfe/mini-event.git"},"bugs":{"url":"https://github.com/ecomfe/mini-event/issues"},"scripts":{"test":"edp test start --singleRun","doc":"esdoc -c esdoc.json","compile":"babel -d . src/","prepublish":"npm run compile"},"edp":{"wwwroot":"/","depDir":"dep","srcDir":"src","main":"main","loaderAutoConfig":"js,htm,html,tpl,vm,phtml","loaderUrl":"http://s1.bdstatic.com/r/www/cache/ecom/esl/1-8-2/esl.js","dependencies":{},"layout":"v2"},"devDependencies":{"babel-cli":"^6.7.7","babel-core":"^6.3.21","babel-plugin-transform-es2015-modules-umd":"^6.6.5","babel-preset-es2015":"^6.3.13","esdoc":"^0.4.4","esdoc-es7-plugin":"0.0.3"},"gitHead":"2615808d55b6d367c241bc5697164588ed57b5a4","homepage":"https://github.com/%3Aecomfe/mini-event#readme","_id":"mini-event@2.3.0","_shasum":"2856f76689c8cb17c9c8fba2fefee6a7c05dfa91","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.1","_npmUser":{"name":"otakustay","email":"otakustay@icloud.com"},"dist":{"shasum":"2856f76689c8cb17c9c8fba2fefee6a7c05dfa91","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/mini-event/-/mini-event-2.3.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/mini-event-2.3.0.tgz_1467257723134_0.7564205720555037"},"directories":{}}},"name":"mini-event","contributors":[{"name":"otakustay","email":"otakustay@gmail.com"}],"time":{"modified":"2016-06-30T03:35:24.594Z","created":"2014-07-16T01:08:05.729Z","1.0.0":"2014-07-16T01:08:05.729Z","1.0.2":"2015-06-07T15:19:22.762Z","2.0.0":"2016-02-25T03:02:40.624Z","2.0.1":"2016-02-25T03:03:06.461Z","2.1.0":"2016-04-29T04:18:32.759Z","2.2.0":"2016-05-25T06:55:19.016Z","2.3.0":"2016-06-30T03:35:24.594Z"},"readmeFilename":"README.md","homepage":"https://github.com/%3Aecomfe/mini-event#readme"}