git-read-pkt-line

read git packet lines (for smart protocol)

8 个版本
安装
npm install git-read-pkt-line
yarn add git-read-pkt-line
pnpm add git-read-pkt-line
bun add git-read-pkt-line
README

git-read-pkt-line

Read git smart protocol packet lines.

var recv = require('git-write-pkt-line')()

recv.on('data', function(d) {
  console.log(d)
})

send.write('0032want 0000000000000000000000000000000000000000\n')

API

this module presents a through stream; when written to it removes the length header; but it leaves the newline ending. if an empty string or buffer is written, it will emit a git "flush packet", which is just a size-0 packet.

after each line received, it checks to see if the next line starts with PACK; and if so will enter recv-pack mode.

data event

{ channel: Number(0) // the sideband data the channel was sent on
, type: 'packfile' | 'pkt-line' | 'pkt-flush'
, size: Number
, data: null | Buffer()
, caps: ['list', 'of', 'capabilities'] }

License

MIT

版本列表
0.0.8 2013-05-22
0.0.7 2013-05-06
0.0.6 2013-05-04
0.0.5 2013-04-05
0.0.4 2013-04-02
0.0.3 2013-03-21
0.0.2 2013-03-21
0.0.1 2013-03-21