git-read-pkt-line
read git packet lines (for smart protocol)
Last updated 11 years ago by chrisdickinson .
MIT · Repository · Original npm · Tarball · package.json
$ npm install git-read-pkt-line 
SYNC missed versions from official npm registry.

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

{ type: 'packfile' | 'pkt-line' | 'pkt-flush' | 'progress' | 'error'
, data: null | Buffer()
, caps: ['list', 'of', 'capabilities'] }

Warning

This module simply passes pack data through. If the source is set to emit side-band or side-band-64k type data, you'll have to use another module to separate that multiplexed data out.

License

MIT

Current Tags

  • 0.0.8                                ...           latest (11 years ago)

8 Versions

  • 0.0.8                                ...           11 years ago
  • 0.0.7                                ...           12 years ago
  • 0.0.6                                ...           12 years ago
  • 0.0.5                                ...           12 years ago
  • 0.0.4                                ...           12 years ago
  • 0.0.3                                ...           12 years ago
  • 0.0.2                                ...           12 years ago
  • 0.0.1                                ...           12 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE