上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页
摘要: 打开github,在github上创建新项目: Repository name: anydoor Descripotion: Tiny NodeJS Static Web server 选择:public 选择:Initialize this repository with a README 添加g 阅读全文
posted @ 2018-12-10 14:07 cicarius 阅读(936) 评论(0) 推荐(0) 编辑
摘要: 匹配模式前/代表项目根目录 匹配模式最后加/代表是目录 匹配模式前加!代表取反 (忽略文件夹,但不忽略文件夹下的某个文件) 代表任意个字符 ? 匹配任意一个字符 匹配多级目录 node_modules/ /index.js 对node_modules下的任意级目录下index.js忽略 阅读全文
posted @ 2018-12-10 13:59 cicarius 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 文件I/O是由简单封装的标准POSIX函数提供。通过require('fs') 使用该模块。所有的方法都有异步和同步的形式。 异步方法的最后一个参数都是一个回调函数。传给回调函数的参数取决于具体方法,但回调函数的第一个参数都会保留给异常。如果操作成功完成,则第一个参数回事null或undefined 阅读全文
posted @ 2018-12-10 12:39 cicarius 阅读(467) 评论(0) 推荐(0) 编辑
摘要: 大多数Node.js核心API都采用惯用的异步事件驱动架构,其中某些类型的对象(触发器)会周期性地触发命名事件来调用函数对象(监听器)。 例如,net.Server对象会在每次有新连接时触发事件;fs.ReadStream会在文件被打开时触发事件;流对象会在数据可读时触发事件。 所有能触发事件的对象 阅读全文
posted @ 2018-12-10 11:41 cicarius 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Buffer.byteLength 4 22 每个中文是3个字节 Buffer.isBuffer false 第一个不是Buffer true 第二个是Buffer Buffer.concat() This is a book 实例的常见用法 buf.length 6 中文字符3个字节 10 固定分 阅读全文
posted @ 2018-12-10 11:04 cicarius 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 1. 新建文件File 》 设置宽度为24px,高度5px;高级选项中将背景图片设置为无色 2. 使用铅笔,前景色设为黑色,画出眼镜的模样,画出反光效果:将前景色设为灰色 3. 放大图片,右击空白区域 》选择图象 》缩放图象 将高度改为40,放大8倍 质量选择None 4. Ctrl+A选择全部,C 阅读全文
posted @ 2018-12-09 17:46 cicarius 阅读(613) 评论(0) 推荐(0) 编辑
摘要: What is Inkscape A program for creating vector graphics For Windows, Mac OS, and Linux Open source Free SVG file format used Great for web graphics Ou 阅读全文
posted @ 2018-12-09 16:43 cicarius 阅读(555) 评论(0) 推荐(0) 编辑
摘要: Buffer用于处理二进制数据流 实例类似于整数数组,大小固定 C++代码在V8堆外分配物理内存 显示如下: 阅读全文
posted @ 2018-12-08 22:00 cicarius 阅读(175) 评论(0) 推荐(0) 编辑
摘要: path 参考文档:http://nodejs.cn/api/path.html 输入 ,可以修正路径 /usr/local/bin /usr/bin 路径拼接: /usr/local/bin 将相对路径转化为绝对路径: /home/dex/web/nodejs basename,dirname,e 阅读全文
posted @ 2018-12-07 16:31 cicarius 阅读(389) 评论(0) 推荐(0) 编辑
摘要: NodeJS简介 Node.js uses an event driven,non blocking I/O model 非阻塞I/O 阻塞:I/O时进程休眠等待I/O完成后进行下一步 非阻塞:I/O时函数立即返回,进程不等待I/O完成 事件驱动 I/O等异步操作结束后通知 观察者模式 CPU密集: 阅读全文
posted @ 2018-12-05 21:57 cicarius 阅读(210) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页