git-transport-protocol

a r/w stream that wraps a r/w stream and formats the data according to the git transfer protocol

MIT 8 个版本
安装
npm install git-transport-protocol
yarn add git-transport-protocol
pnpm add git-transport-protocol
bun add git-transport-protocol
README

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

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