diff --git a/README.md b/README.md index 25b31b588..c2df6afe0 100644 --- a/README.md +++ b/README.md @@ -12,18 +12,39 @@ Nuclear used js , html+css and observejs instead of jsx , virtual dom and reques the file is here: [nuclear.js](https://raw.githubusercontent.com/AlloyTeam/Nuclear/master/dist/nuclear.js) or [nuclear.min.js](https://raw.githubusercontent.com/AlloyTeam/Nuclear/master/dist/nuclear.min.js) -include the file in your html,such as: - -```html - -``` - You can also install it via npm: ```html npm install alloynuclear ``` +Nuclear can be used in the CommonJS/AMD module definition environment, but also directly through the script tag reference in your page ,such as: + +```html + +``` + +you can get the Nuclear module by synchronizing require in the AMD module definition environment: + +```javascript +define(function (require) { + var Nuclear = require('nuclear'); +}); +``` + +or asynchronous require: + +```javascript +require([ 'nuclear' ], function (Nuclear) { +}); +``` + +or require in the CommonJS module definition environment: + +```javascript +var Nuclear = require('nuclear'); +``` + # Many thanks to * [observe.js](https://github.com/kmdjs/observejs) * [react.js](http://facebook.github.io/react/) @@ -31,4 +52,4 @@ npm install alloynuclear * [class.js](http://ejohn.org/blog/simple-javascript-inheritance/) # License -This content is released under the [MIT](http://opensource.org/licenses/MIT) License. \ No newline at end of file +This content is released under the [MIT](http://opensource.org/licenses/MIT) License.