nodejs
gjc9620
这个作者很懒,什么都没留下…
展开
-
npm 常用命令
npm 是官方的 node.js 包管理器,已包含在 nodejs 中.使用 npm 管理包安装软件包任何包可以用以下命令安装:$ npm install packageName这个命令会将包安装在当前目录下 node_modules 目录内,可执行命令(如果有)安装在 node_modules/.bin 目录下.作为系统级的全局安装使用 -g 选项:转载 2015-03-02 10:21:53 · 644 阅读 · 0 评论 -
使用node-inspector 调试nodejs程序
使用node-inspector 调试nodejs 程序原创 2015-05-27 14:18:11 · 453 阅读 · 0 评论 -
理解异步,同步,阻塞,非阻塞之间的关系
在学习nodejs时应该会说 nodejs是 异步非阻塞i/o而以前却并不了解这句话的意思 今天要梳理一下这些概念首先 同步与异步 同步于异步关注的是消息通信机制 (synchronous communication/ asynchronous communication)。 同步:调用者等待被调用者的返回值之后,调用者才继续工作 异步:调用者调用之后被调用者马上返回,但是这里是没有返回结果的原创 2015-08-13 23:10:01 · 635 阅读 · 0 评论 -
[es6]Symbol.iterator 和 for of
使用 Symbol.iterator for of s6 学习笔记原创 2015-08-15 13:34:28 · 3385 阅读 · 0 评论 -
Duff装置
Duff装置 性能优化转载 2015-09-01 14:46:02 · 1073 阅读 · 0 评论 -
es6 标准 Promise 学习笔记
es6离我们越来越近 node4.0也推出了 原生浏览器 也逐渐支持promise他能帮助我们从个callback hell中脱离出来为什么我们要使用promise呢?fs.readFileAsync("a.json",function(e1,d1){ if(e1){ //todo }else{ fs.readFileAsync("b.j原创 2015-09-20 18:01:11 · 553 阅读 · 0 评论 -
使用child_process 执行命令
const exec = require('child_process').exec;const child = exec('cat aaaa.html bad_file | wc -l', function(error, stdout, stderr) { console.log(`stdout: ${stdout}`); console.log(`stderr: ${std原创 2016-02-15 15:30:16 · 2021 阅读 · 0 评论