V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
metrue
V2EX  ›  分享创造

你想看看你的 Node 项目依赖的第三方代码质量如何么,你可以这样做

  •  
  •   metrue ·
    metrue · 2016-09-07 11:39:34 +08:00 · 2442 次点击
    这是一个创建于 2803 天前的主题,其中的信息可能已经有所发展或是发生改变。

    你可以这样做。

    npm install -g npm-deps-stats
    
    cd <your project>
    npm-stats
    

    hack to the codes -> https://github.com/metrue/npm-stats

    screen shot screen_shot

    12 条回复    2016-09-09 23:32:30 +08:00
    phoenixlzx
        1
    phoenixlzx  
       2016-09-07 12:26:13 +08:00
    个人认为 Star/watch/fork/issue 已经不再代表代码质量。
    metrue
        2
    metrue  
    OP
       2016-09-07 12:34:53 +08:00
    @phoenixlzx 只是一定程度上了解一下你的依赖吧,要真正的衡量不容易。
    Senorsen
        3
    Senorsen  
       2016-09-07 12:36:54 +08:00
    不错,已 star
    phoenixlzx
        4
    phoenixlzx  
       2016-09-07 13:32:01 +08:00
    @metrue 不如 lint 一下 node_modules 里的代码(ry
    metrue
        5
    metrue  
    OP
       2016-09-07 14:09:24 +08:00
    @phoenixlzx 看个人需求吧。
    rupert
        6
    rupert  
       2016-09-07 17:31:16 +08:00
    再牛逼的库也发现不少问题 或者叫 feature, 得看源码 debug
    metrue
        7
    metrue  
    OP
       2016-09-07 18:05:30 +08:00
    @rupert 嗯,那就发 PR 吧,哈哈。
    colatin
        8
    colatin  
       2016-09-07 21:44:00 +08:00
    不如看有没有 tsd
    songjiaxin2008
        9
    songjiaxin2008  
       2016-09-07 21:44:53 +08:00
    不如看看 issue 都是多少天处理完
    lincanbin
        10
    lincanbin  
       2016-09-07 22:02:57 +08:00
    我还以为代码质量,是指单元测试的覆盖度……
    ericls
        11
    ericls  
       2016-09-09 23:01:19 +08:00
    我以为可以看 test coverage

    而去 npm 和 github 社区还是分得比较开

    有时候 npm 上很热门的 github 上没什么人。。。
    metrue
        12
    metrue  
    OP
       2016-09-09 23:32:30 +08:00
    @ericls 这当然也是有的, 只是并不是所有的项目都有 covearge 信息。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2972 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 13:23 · PVG 21:23 · LAX 06:23 · JFK 09:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.