4 Star 4 Fork 4

蓝飞 / GoJS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

#GoJS

GoJS 是一个适用于 Web 的 JavaScript 模块加载器,它可以帮助你更优雅地组织代码和模块。它解决了模块之间的依赖问题和命名冲突问题,同时也解决了同类框架中合并压缩成本高的问题,让你能够更加轻松愉快地享受编码的乐趣。README in English

##如何使用

###第一步,初始化GoJS

<!--
data-main: 入口模块
-->
<script id="gojsnode" src="path/to/go.js" data-main="main"></script>

或者 进行配置 后再初始化入口模块:

<script src="path/to/go.js"></script>
<script>
// 配置 GoJS
gojs.config({
	// 一些配置选项
});
// 加载入口模块
gojs.use('main');
</script>

###第二步,编写遵循 CMD规范 的模块

// main.js
define(function(require, exports, module){

	var foo = require('foo');
	foo.bar();

});
// foo.js
define(function(require, exports, module){

	exports.bar = function(){
		// your codes
	}

});

###第三步,享受编码的乐趣吧!

##兼容性

GoJS兼容所有主流浏览器:

Chrome 3+
Firefox 2+
Safari 3.2+
Opera 9+
IE 5.5+

理论上,GoJS可以运行在任何浏览器环境上。

##开源许可

GoJS遵循 MIT 协议,无论个人还是公司,都可以免费自由地使用。

##说点什么

最后,向 RequireJSSea.js 致敬,也向所有投身于开源工作的自由人致敬。

—— 张耕畅 于2014年11月05日

The MIT License (MIT) Copyright (c) 2014 蓝飞 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一个基于 CMD 规范的 JavaScript 模块加载器。 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/lanfei/GoJS.git
git@gitee.com:lanfei/GoJS.git
lanfei
GoJS
GoJS
master

搜索帮助

14c37bed 8189591 565d56ea 8189591