0.0.8 • Published 11 years ago

git-read-pkt-line v0.0.8

Weekly downloads
51,484
License
-
Repository
github
Last release
11 years ago

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

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago