Using ES6To use ES6, we need loader.Modify webpack.config.js file:module.exports = { entry: './index.js', output: { filename: 'bundle.js'...
分类:
编程语言 时间:
2015-03-04 06:15:09
阅读次数:
306
To use webpack, first you need to run:npm install webpack2. Create a webpack.config.js file:module.exports = { entry: './index.js', output: { ...
分类:
编程语言 时间:
2015-03-03 06:22:08
阅读次数:
210
一个文件就是一个模块exports公开接口创建exports.jsvar i;
exports.set = function(num){//设置值
i=num;
console.log("seti to "+i);
}
exports.square = function(){//求平方并输出
i=Math.pow(i,2);...
分类:
Web程序 时间:
2015-02-28 18:45:50
阅读次数:
199
html:main.jsrequire.config({ baseUrl: 'js', shim: { "zepto": { exports: "$" } }});if(/AppleWebKit.*Mobile/i.test(nav...
分类:
移动开发 时间:
2015-02-24 12:32:34
阅读次数:
171
Express在使用mongodb的时候app配置出错! "Cannot read property 'Store' of undefined"
原因主要是express版本4++问题
//settings.js
module.exports={
cookieSecret:"xxxx",
db:"dbname",
host:"localhost",
}...
分类:
Web程序 时间:
2015-02-19 23:02:59
阅读次数:
405
1.按照CommonJS规范,在任何模块代码的作用域下内置了以下哪些变量? A, module B,context C, require D,exports答:A,C,D可以参考:阮一峰commjs文章:输出模块变量的最好方法是使用module.exports对象,加载模块使用req...
分类:
其他好文 时间:
2015-02-15 18:05:08
阅读次数:
161
我们做东西不可能把所有的功能都放在一起,那样会相互影响,我们需要把他们分门别类,让他们各自执行各自的功能,这就是包或者模块,包和模块这两个概念经常地会用,其实他俩讲的是一个东西而在node.js中一个文件就是一个包下面我们就来具体的讲解一下:Node.js提供了exports和..
分类:
Web程序 时间:
2015-02-11 18:52:13
阅读次数:
205
vi/etc/exports#需要在root权限下在该文件中按照如下格式插入:需要共享文件的绝对路径可以接受该文件的服务器IP(rw,no_root_squash,sync)保存文件重启NFS:servicenfsrestart或是/etc/init.d/nfsrestart启动protmap:serviceprotmaprestart登录到接收共享目录的服务器vi/etc/exp..
分类:
系统相关 时间:
2015-02-07 23:06:29
阅读次数:
230
一、使用NFS在Linux系统之间共享文件资源1、配置NFS服务器端的文件共享权限配置exports文件:[root@clz~]#vim/etc/exports/aa10.35.89.0/26(rw,rsync)查看nfs默认的共享配置:[root@clznfs]#cat/var/lib/nfs/etab
/aa10.35.89.0/26(rw,sync,wdelay,hide,nocrossmnt,secure,root..
分类:
其他好文 时间:
2015-02-01 20:33:05
阅读次数:
305
grunt已经扯了七篇了,殊为不易。最后一篇扯点早应该提及的东西,就是module.exports = function(grunt) {}传入的这个grunt。之前的代码grunt一般只出现在Gruntfile.js这几个地方。require('load-grunt-tasks')(grunt.....