V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
zficode
V2EX  ›  编程

nodejs 如何高效读取 git 文件

  •  
  •   zficode · Sep 15, 2023 · 1330 views
    This topic created in 956 days ago, the information mentioned may be changed or developed.

    现在我正在开发一个 node CLI 工具, 需要在不切换分支的情况下读取某个 commit 的某个文件内容,目前用 child_process 的 execSyc 方法执行命令去获取,但是速度很慢。

    ZeoKarl
        1
    ZeoKarl  
       Sep 15, 2023 via iPhone
    试试 nodegit2
    ZeoKarl
        2
    ZeoKarl  
       Sep 15, 2023 via iPhone
    @nieyujiang 不对,就叫 nodegit
    zficode
        3
    zficode  
    OP
       Sep 25, 2023
    @nieyujiang 用了,还可以
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1327 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 23:50 · PVG 07:50 · LAX 16:50 · JFK 19:50
    ♥ Do have faith in what you're doing.