git-transport-protocol
a r/w stream that wraps a r/w stream and formats the data according to the git transfer protocol
Last updated 12 years ago by chrisdickinson .
MIT · Repository · Original npm · Tarball · package.json
$ npm install git-transport-protocol 
SYNC missed versions from official npm registry.

git-transport-protocol

wrap a r/w stream in this transport r/w stream for transforming writes into valid git packet lines, and reads from git packet lines into JS objects.

var net = require('net')
  , transport = require('git-transport-protocol')
  , client
  , tcp

tcp = net.connect({host: 'github.com', port: 9418})

client = transport(tcp)

client.on('data', function(data) {
  // data will be JS objects
})

// start a fetch
client.write('git-upload-pack /chrisdickinson/plate.git\0host=github.com\0')

API

transport(connection) -> client

wrap any readable/writable stream with git-packet-line senders and receivers.

client.setRawMode([true]) -> rawmode boolean

enter or exit "raw" mode -- this makes writes skip the pkt-write portion of the stream and go directly to the connection.

this is useful for, e.g., sending packfile data.

License

MIT

Current Tags

  • 0.1.0                                ...           latest (11 years ago)

8 Versions

  • 0.1.0                                ...           11 years ago
  • 0.0.7                                ...           11 years ago
  • 0.0.6                                ...           11 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 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (2)
Dependents (1)

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