nodejs 编程建议(代码规范)

  1. 不要使用 "try ... catch" ,由于nodejs都是异步操做,try catch没法捕捉回调里面的异常,除非你在回调里面也写try catch try...catch statement cannot catch the error in callback. Here is an example: fs = require('fs'); try { fs.stat('
相关文章
相关标签/搜索