sox
V2EX  ›  Node.js

Node.js 模块风格指南

  •  1
     
  •   sox · Jan 29, 2016 · 3873 views
    This topic created in 3782 days ago, the information mentioned may be changed or developed.
    11 replies    2016-01-29 22:53:19 +08:00
    adoyle
        1
    adoyle  
       Jan 29, 2016
    哇哦,博客很酷哦
    magicdawn
        2
    magicdawn  
       Jan 29, 2016
    superagent promisify using bluebird

    const request = require('superagent');
    const Request = request.Request;
    Request.prototype.endAsync = Promise.promisify(Request.prototype.end);
    sox
        3
    sox  
    OP
       Jan 29, 2016
    @magicdawn 不如直接 fetch 233
    libook
        4
    libook  
       Jan 29, 2016
    赞一个
    magicdawn
        5
    magicdawn  
       Jan 29, 2016
    @sox 看你一会 superagent, 一会 node-fetch ... 不太好 ...
    int64ago
        6
    int64ago  
       Jan 29, 2016
    还是弄个域名吧,看你 GitHub 已经很牛了
    libook
        7
    libook  
       Jan 29, 2016
    加个 Disqus 呗~
    sox
        8
    sox  
    OP
       Jan 29, 2016
    @magicdawn 这不是演示 callback 和 Promise 吗。。
    magicdawn
        9
    magicdawn  
       Jan 29, 2016
    @sox !!!
    sox
        10
    sox  
    OP
       Jan 29, 2016
    sox
        11
    sox  
    OP
       Jan 29, 2016
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2862 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 08:11 · PVG 16:11 · LAX 01:11 · JFK 04:11
    ♥ Do have faith in what you're doing.