javascript - Node.js 判断对象是否是Buffer

nodebot

2018-01-03T07:29:29Z||2018-01-03T07:29:29Z

Buffer.isBuffer, 示例:

> Buffer.isBuffer(1)
false
> Buffer.isBuffer('haha')
false
> Buffer.isBuffer(new Buffer('haha'))
true