Node.js 知识大挑战
- 请说明 Node.js 和 V8 的关系?Node 没有 V8 可否正常运行?
- How come when you declare a global variable in any Node.js file it’s not really global to all modules?
- Export 一个 Node 模块的 API 时,为何有时能够用
exports
有时却必须使用 module.exports
?
- 不用相对路径是否能够实现 require 本地文件(local files)?
- 一个应用是否能够同时使用某个包的多个不一样版本?
- 什么是 Event Loop?它是 V8 的一部分吗?
- 什么是调用栈 (Call Stack)?它是 V8 的一部分吗?
setImmediate
和 process.nextTick
的区别?
- How do you make an asynchronous function return a value?
- 回调能和 promise 一块儿使用吗?若是能的话,有几种方式?
- What Node module is implemented by most other Node modules?
spawn
、exec
与 fork
的主要区别?
- cluster 模块如何工做?它跟负载均衡的区别是?
--harmony-*
标志是什么?
- 如何读取并检查 Node.js 进程的内存使用状况?
- 当调用栈和事件循环都为空时,Node 将会发生什么?
- V8 对象和函数模板是什么?
- 什么是 libuv? Node.js 怎么使用它的?
- 如何使 Node 的 REPL 始终使用 JavaScript 严格模式?
- 什么是
process.argv
?它拥有哪些数据?
- 如何实如今 Node 进程退出前执行最后一个操做?这个能异步执行吗?
- 有哪些能够在 Node REPL 中使用的内置 dot commands?
- 除了 V8 与 libuv,Node 还有其它外部依赖吗?
- 进程
uncaughtException
事件有什么问题?它与 exit
事件有什么不一样?
- Node REPL 中
_
的含义?
- Node 缓冲区(buffer)占用 V8 内存吗?它们大小可调吗?
Buffer.alloc
与 Buffer.allocUnsafe
的区别?
- 缓冲区 (buffer) 上的
slice
与数组(array)上的区别?
string_decoder
模块的做用?它与转换缓冲区为字符串有什么区别?
- require 函数的五个主要步骤?
- 如何检查本地模块 (local module) 是否存在?
package.json
中 main
属性的做用?
- 什么是循环模块引用?如何避免?
- require 函数支持的自动尝试文件后缀是哪三个?
- 建立一个 http server 而且返回一个响应,为何
end()
函数是必须的?
- 什么场景下能使用
*Sync
方法?
- 如何仅打印多层嵌套对象的第一层?How can you print only one level of a deeply nested object?
node-gyp
包的做用?
- 如何实现
exports
, require
和 module
在每一个模块中均全局可用,可是在每一个模块中却不一样?
- 假设执行一个只有一行
console.log(arguments);
的 node 脚本,请问输出是什么?
- 如何实现一个模块既能被其余模块 require 引用又能直接经过
node
命令行调用?
- 请给出一个 node 中既可读又可写的内置流 (stream) 的例子?
- 在 node 脚本中执行
cluster.fork()
将会发生什么?
- What’s the difference between using event emitters and using simple callback functions to allow for asynchronous handling of code?
console.time
的做用?
- What’s the difference between the Paused and the Flowing modes of readable streams?
- Node 命令的
--inspect
参数的做用?
- 如何从已经链接的套接字中读取数据?
require
函数总会缓存引用的模块。若是须要屡次执行所引用模块中的代码,你会怎么作?
- 使用流 (stream) 时,什么场景下使用 pipe 函数?什么场景下使用事件?这两种方法能够一块儿使用吗?
欢迎关注本站公众号,获取更多信息