{"maintainers":[{"name":"farthinker","email":"farthinker@gmail.com"}],"dist-tags":{"latest":"3.0.3"},"author":{"name":"farthinker"},"description":"A base class for javascript modules.","readme":"# Simple Module\n\n[![Latest Version](https://img.shields.io/npm/v/simple-module.svg)](https://www.npmjs.com/package/simple-module)\n[![Build Status](https://img.shields.io/travis/mycolorway/simple-module.svg)](https://travis-ci.org/mycolorway/simple-module)\n[![Coveralls](https://img.shields.io/coveralls/mycolorway/simple-module.svg)](https://coveralls.io/github/mycolorway/simple-module)\n[![David](https://img.shields.io/david/mycolorway/simple-module.svg)](https://david-dm.org/mycolorway/simple-module)\n[![David](https://img.shields.io/david/dev/mycolorway/simple-module.svg)](https://david-dm.org/mycolorway/simple-module#info=devDependencies)\n[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/mycolorway/simple-module)\n\nSimpleModule is a simple base class providing some necessary features to make its subclasses extendable.\n\n## Features\n\n#### Events\n\nSimpleModule delegate events mothods to jQuery object:\n\n```js\nlet module = new SimpleModule();\n\n// bind namespace event\nmodule.on('customEvent.test', function(data) {\n  console.log(data);\n});\n// equivalent to\n$(module).on('customEvent.test', function(data) {\n  console.log(data);\n});\n\n// trigger a namespace event\nmodule.trigger('customEvent.test', 'test');\n// equivalent to\n$(module).trigger('customEvent.test', 'test');\n```\n\n#### Mixins\n\nAdd class properties and methods to SimpleModule:\n\n```js\nvar testMixins = {\n  classProperty: true,\n  classMethod: function() {}\n};\n\nSimpleModule.extend(testMixins);\n```\n\nAdd instance properties and methods to SimpleModule:\n\n```js\nvar testMixins = {\n  instanceProperty: true,\n  instanceMethod: function() {}\n};\n\nSimpleModule.include(testMixins);\n```\n\n#### Plugins\n\nRegister a plugin on SimpleModule:\n\n```js\nclass TestPlugin extends SimpleModule {\n  constructor(module) {\n    super()\n    this.module = module;\n    this.test = true;\n  }\n}\n\nSimpleModule.plugin('testPlugin', TestPlugin);\n```\n\nThen pass the plugin name to options while creating instance:\n\n```js\nlet module = new SimpleModule({\n  plugins: ['testPlugin']\n});\nconsole.log(module.plugins.testPlugin.test); // true\n```\n\n## Installation\n\nInstall via npm:\n\n```bash\nnpm install --save simple-module\n```\n\nInstall via bower:\n\n```bash\nbower install --save simple-module\n```\n\n## Issues\n\nIf you have issues about this module, please consider discussing it on [Gitter channel](https://gitter.im/mycolorway/simple-module) first.\n\nIf you confirm the issue is indeed a bug, please browse the [issues page](https://github.com/mycolorway/simple-module/issues) for existing issues describing the same problem before creating new issue.\n\nWhen you create new issue, please describe it with detailed information, for example, demo code, error stacks, screenshots etc. Issues without enough debug information will probably be closed.\n\n## Development\n\nClone repository from github:\n\n```bash\ngit clone https://github.com/mycolorway/simple-module.git\n```\n\nInstall npm dependencies:\n\n```bash\nnpm install\n```\n\nRun default gulp task to build project, which will compile source files, run test and watch file changes for you:\n\n```bash\ngulp\n```\n\nNow, you are ready to go.\n\n## Publish\n\nIf you want to publish new version to npm and bower, please make sure all tests have passed before you publish new version, and you need do these preparations:\n\n* Add new release information in `CHANGELOG.md`. The format of markdown contents will matter, because build scripts will get version and release content from this file by regular expression. You can follow the format of the older release information.\n\n* Put your [personal API tokens](https://github.com/blog/1509-personal-api-tokens) in `/.token.json`, which is required by the build scripts to request [Github API](https://developer.github.com/v3/) for creating new release:\n\n```json\n{\n  \"github\": \"[your github personal access token]\"\n}\n```\n\nNow you can run `gulp publish` task, which will do these work for you:\n\n* Get version number from `CHANGELOG.md` and bump it into `package.json` and `bower.json`.\n* Get release information from `CHANGELOG.md` and request Github API to create new release.\n\nIf everything goes fine, you can see your release at [https://github.com/mycolorway/simple-module/releases](https://github.com/mycolorway/simple-module/releases). At the End you can publish new version to npm with the command:\n\n```bash\nnpm publish\n```\n\nPlease be careful with the last step, because you cannot delete or republish a version on npm.\n","repository":{"type":"git","url":"git+https://github.com/mycolorway/simple-module.git"},"users":{"farthinker":true},"bugs":{"url":"https://github.com/mycolorway/simple-module/issues"},"license":"MIT","versions":{"2.0.5":{"name":"simple-module","version":"2.0.5","description":"A abstract class for module and UI widget.","repository":{"type":"git","url":"git@github.com:mycolorway/simple-module.git"},"author":{"name":"farthinker"},"license":"MIT","bugs":{"url":"https://github.com/mycolorway/simple-module/issues"},"homepage":"https://github.com/mycolorway/simple-module","main":"lib/module.js","dependencies":{"jquery":"2.x"},"devDependencies":{"grunt":"0.x","grunt-contrib-watch":"0.x","grunt-contrib-coffee":"0.x","grunt-contrib-jasmine":"0.x","grunt-umd":"2.x"},"gitHead":"31c9f6d1a62f170d0a49381159ae3a834f656176","_id":"simple-module@2.0.5","scripts":{},"_shasum":"f8df78c30ce28da0517594e3e0f3f6f937b4ecee","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"farthinker","email":"farthinker@gmail.com"},"maintainers":[{"name":"farthinker","email":"farthinker@gmail.com"}],"dist":{"shasum":"f8df78c30ce28da0517594e3e0f3f6f937b4ecee","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/simple-module/-/simple-module-2.0.5.tgz"},"directories":{}},"2.0.6":{"name":"simple-module","version":"2.0.6","description":"A abstract class for module and UI widget.","repository":{"type":"git","url":"git@github.com:mycolorway/simple-module.git"},"author":{"name":"farthinker"},"license":"MIT","bugs":{"url":"https://github.com/mycolorway/simple-module/issues"},"homepage":"https://github.com/mycolorway/simple-module","main":"lib/module.js","dependencies":{"jquery":"2.x"},"devDependencies":{"grunt":"0.x","grunt-contrib-watch":"0.x","grunt-contrib-coffee":"0.x","grunt-contrib-jasmine":"0.x","grunt-umd":"2.x"},"gitHead":"42cddcd5e9b60d28a480526cbcd9f9fe529b2a56","_id":"simple-module@2.0.6","scripts":{},"_shasum":"cec8250325f8c7f575f4aa75c919b38396a6037b","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"farthinker","email":"farthinker@gmail.com"},"maintainers":[{"name":"farthinker","email":"farthinker@gmail.com"}],"dist":{"shasum":"cec8250325f8c7f575f4aa75c919b38396a6037b","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/simple-module/-/simple-module-2.0.6.tgz"},"directories":{}},"3.0.1":{"name":"simple-module","githubOwner":"mycolorway","version":"3.0.1","description":"A base class for javascript modules.","homepage":"http://mycolorway.github.io/simple-module","repository":{"type":"git","url":"git+https://github.com/mycolorway/simple-module.git"},"author":{"name":"farthinker"},"license":"MIT","bugs":{"url":"https://github.com/mycolorway/simple-module/issues"},"main":"dist/simple-module.js","scripts":{"start":"gulp","test":"gulp test"},"dependencies":{"eventemitter2":"^1.0.0","lodash":"^4.5.1"},"devDependencies":{"coffee-script":"^1.10.0","gulp":"^3.9.1","gulp-gh-pages":"^0.5.4","gulp-util":"^3.0.7","jade":"^1.11.0","jasmine":"^2.4.1","jstransformer-markdown-it":"^0.2.2","node-sass":"^3.4.2","request":"^2.69.0","run-sequence":"^1.1.5","through2":"^2.0.1","uglify-js":"^2.6.2"},"gitHead":"135582aaeb3f871013afefda86a2f84c8e5fbc88","_id":"simple-module@3.0.1","_shasum":"4abc730f88dcda1eaef50c3a6ee8a559c69bdd32","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.8.0","_npmUser":{"name":"farthinker","email":"farthinker@gmail.com"},"maintainers":[{"name":"farthinker","email":"farthinker@gmail.com"}],"dist":{"shasum":"4abc730f88dcda1eaef50c3a6ee8a559c69bdd32","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/simple-module/-/simple-module-3.0.1.tgz"},"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/simple-module-3.0.1.tgz_1458054167355_0.5651295185089111"},"directories":{}},"3.0.2":{"name":"simple-module","githubOwner":"mycolorway","version":"3.0.2","description":"A base class for javascript modules.","homepage":"http://mycolorway.github.io/simple-module","repository":{"type":"git","url":"git+https://github.com/mycolorway/simple-module.git"},"author":{"name":"farthinker"},"license":"MIT","bugs":{"url":"https://github.com/mycolorway/simple-module/issues"},"main":"dist/simple-module.js","scripts":{"start":"gulp","test":"gulp test"},"dependencies":{"eventemitter2":"^1.0.0","lodash":"^4.5.1"},"devDependencies":{"chai":"^3.5.0","coffee-coverage":"^1.0.1","coffee-script":"^1.10.0","coffeelint":"^1.15.0","gulp":"^3.9.1","gulp-gh-pages":"^0.5.4","gulp-util":"^3.0.7","istanbul":"^0.4.2","jade":"^1.11.0","jstransformer-markdown-it":"^0.2.2","mocha":"^2.4.5","node-sass":"^3.4.2","request":"^2.69.0","run-sequence":"^1.1.5","through2":"^2.0.1","uglify-js":"^2.6.2"},"gitHead":"cac0a8c78e645cd099a0af23e63f7b45834a1fe8","_id":"simple-module@3.0.2","_shasum":"20c9db852ab8b23de540b69266b905dd13003032","_from":".","_npmVersion":"3.8.1","_nodeVersion":"5.8.0","_npmUser":{"name":"farthinker","email":"farthinker@gmail.com"},"maintainers":[{"name":"farthinker","email":"farthinker@gmail.com"}],"dist":{"shasum":"20c9db852ab8b23de540b69266b905dd13003032","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/simple-module/-/simple-module-3.0.2.tgz"},"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/simple-module-3.0.2.tgz_1458373603917_0.9445336207281798"},"directories":{}},"3.0.3":{"name":"simple-module","githubOwner":"mycolorway","version":"3.0.3","description":"A base class for javascript modules.","homepage":"http://mycolorway.github.io/simple-module","repository":{"type":"git","url":"git+https://github.com/mycolorway/simple-module.git"},"author":{"name":"farthinker"},"license":"MIT","bugs":{"url":"https://github.com/mycolorway/simple-module/issues"},"main":"dist/simple-module.js","scripts":{"start":"gulp","test":"gulp test"},"dependencies":{"jquery":"^3.0.0"},"devDependencies":{"browserify":"^13.0.0","chai":"^3.5.0","coffee-coverage":"^1.0.1","coffee-script":"^1.10.0","coffeelint":"^1.15.0","coveralls":"^2.11.8","gulp":"github:gulpjs/gulp#4.0","gulp-util":"^3.0.7","istanbul":"^0.4.2","lodash":"^4.13.1","mocha":"^2.4.5","mocha-phantomjs-core":"^2.0.0","node-sass":"^3.8.0","phantomjs-prebuilt":"^2.1.7","through2":"^2.0.1","uglify-js":"^2.6.2"},"gitHead":"500793ce48338c940e575c6ad21dedc34318f70d","_id":"simple-module@3.0.3","_shasum":"ad52766785d27cd9427ee8645a49e41199725a92","_from":".","_npmVersion":"3.8.1","_nodeVersion":"5.8.0","_npmUser":{"name":"farthinker","email":"farthinker@gmail.com"},"maintainers":[{"name":"farthinker","email":"farthinker@gmail.com"}],"dist":{"shasum":"ad52766785d27cd9427ee8645a49e41199725a92","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/simple-module/-/simple-module-3.0.3.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/simple-module-3.0.3.tgz_1466436621921_0.33724610367789865"},"directories":{}}},"name":"simple-module","time":{"modified":"2016-06-20T15:30:23.335Z","created":"2013-09-21T18:10:53.813Z","0.0.1":"2013-09-21T18:11:00.466Z","2.0.4":"2015-05-19T01:32:43.662Z","2.0.5":"2015-05-19T02:20:02.125Z","2.0.6":"2015-05-19T04:16:18.239Z","3.0.0":"2016-03-15T14:02:12.633Z","3.0.1":"2016-03-15T15:02:47.834Z","3.0.2":"2016-03-19T07:46:46.396Z","3.0.3":"2016-06-20T15:30:23.335Z"},"readmeFilename":"README.md","homepage":"http://mycolorway.github.io/simple-module"}