{"_id":"git-fetch-pack","_rev":"13-bfa067c393799dc91fa1a786a1d5f502","name":"git-fetch-pack","description":"git's smart fetch-pack protocol","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.1":{"name":"git-fetch-pack","version":"0.0.1","description":"git's smart fetch-pack protocol","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/git-fetch-pack.git"},"keywords":["git","smart","clone","fetch","protocol"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","gitHead":"7f039633bab60bf9b5fa994ab3bb8529da53c1fe","dependencies":{"emit-function":"0.0.2","through":"~2.2.7","git-packed-ref-parse":"0.0.0"},"devDependencies":{"git-fs-repo":"0.0.1","git-transport-protocol":"0.0.1","git-walk-refs":"0.0.1"},"_id":"git-fetch-pack@0.0.1","dist":{"shasum":"a6dc8e4c559857a985c1f731b78589efb9560aa7","tarball":"https://registry.npmjs.org/git-fetch-pack/-/git-fetch-pack-0.0.1.tgz","integrity":"sha512-QqElxh6KUdB05L6QWQDJ75rppGN7DheXb7S8hfmljMBxMxKFCJq5dUNOmgkEUvmnh1bNTSBAEGsVGicac7W96A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGUKURgYq+Tm+4BG2t1NhBbev5zw53qe+Htj+usJEKzKAiAsM9elNgcQjzqjOmUrJFSVMOiTCcbaNXO592NSPaqBqw=="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":"chris@neversaw.us"}]},"0.0.2":{"name":"git-fetch-pack","version":"0.0.2","description":"git's smart fetch-pack protocol","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/git-fetch-pack.git"},"keywords":["git","smart","clone","fetch","protocol"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","gitHead":"7f039633bab60bf9b5fa994ab3bb8529da53c1fe","dependencies":{"emit-function":"0.0.2","through":"~2.2.7","git-packed-ref-parse":"0.0.0","bops":"0.0.2"},"devDependencies":{"git-fs-repo":"0.0.1","git-transport-protocol":"0.0.4","git-walk-refs":"0.0.1"},"_id":"git-fetch-pack@0.0.2","dist":{"shasum":"3d43b67110c848f4f974f34274ecbacfefd689b6","tarball":"https://registry.npmjs.org/git-fetch-pack/-/git-fetch-pack-0.0.2.tgz","integrity":"sha512-/JPISp+aJrXm/XTj3wWl6kwD5qee2+ZBvBG71pQua7Y8NPwrv3icTSeZbNVV2CQa5w8IjTnuB49RuTwiEKJpqA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICzWLMEWFocDAiWOAHtgW8MuDC6b7tM8/uaNH8rTb7MWAiEAwloiEvHqDkwUtTx1hK9NqWiC+oV+x29hrPdQemHwK08="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":"chris@neversaw.us"}]},"0.0.3":{"name":"git-fetch-pack","version":"0.0.3","description":"git's smart fetch-pack protocol","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/git-fetch-pack.git"},"keywords":["git","smart","clone","fetch","protocol"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","gitHead":"7f039633bab60bf9b5fa994ab3bb8529da53c1fe","dependencies":{"emit-function":"0.0.2","through":"~2.2.7","git-packed-ref-parse":"0.0.0","bops":"0.0.3"},"devDependencies":{"git-fs-repo":"0.0.1","git-transport-protocol":"0.0.5","git-walk-refs":"0.0.1"},"_id":"git-fetch-pack@0.0.3","dist":{"shasum":"550db5b694db605942254ce5dedf17ef8b1e3364","tarball":"https://registry.npmjs.org/git-fetch-pack/-/git-fetch-pack-0.0.3.tgz","integrity":"sha512-C96OM6qPQweOGSNYXn/Etd+TmKvh85zteO9Wff1VsWswqw288w8JZtCHSZo7rPHWG2181MVHBKP1UA8o2UWFig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFXyD6swzx6ARGORkQ9JD0frCwrGCcIdHGpvY0wvjlbnAiAiwrJYvoPsIAfX80FGzjSjg+qSbufbfSH22+++q3JoJw=="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":"chris@neversaw.us"}]},"0.1.0":{"name":"git-fetch-pack","version":"0.1.0","description":"git's smart fetch-pack protocol","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/git-fetch-pack.git"},"keywords":["git","smart","clone","fetch","protocol"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","gitHead":"7f039633bab60bf9b5fa994ab3bb8529da53c1fe","dependencies":{"emit-function":"0.0.2","through":"~2.2.7","git-packed-ref-parse":"0.0.0","bops":"0.0.3"},"devDependencies":{"git-fs-repo":"0.0.1","git-transport-protocol":"0.1.0","git-walk-refs":"0.0.1"},"bugs":{"url":"https://github.com/chrisdickinson/git-fetch-pack/issues"},"homepage":"https://github.com/chrisdickinson/git-fetch-pack","_id":"git-fetch-pack@0.1.0","dist":{"shasum":"1adc4c959eacd558b5ce22121d11f9c7fce9ed66","tarball":"https://registry.npmjs.org/git-fetch-pack/-/git-fetch-pack-0.1.0.tgz","integrity":"sha512-RHt6eXttZ9LjyhUHBP1fNCcfgMOnp4E68Q/cjJ+bA+IDCLm1MeA3YwtVEvWOoCU8PP/YDdRpNaIuUURPD7v/jQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFSN+9GxYNrBolFEB4g/CjIIipgYsUZtmMaqEoVnj3UJAiEAuVsQWFgRXtOMMsT3KkvY4ToEVRYtWmB6s56CkV2/TQE="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":"chris@neversaw.us"}]},"0.1.1":{"name":"git-fetch-pack","version":"0.1.1","description":"git's smart fetch-pack protocol","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/git-fetch-pack.git"},"keywords":["git","smart","clone","fetch","protocol"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","gitHead":"7f039633bab60bf9b5fa994ab3bb8529da53c1fe","dependencies":{"emit-function":"0.0.2","through":"~2.2.7","git-packed-ref-parse":"0.0.0","bops":"0.0.3"},"devDependencies":{"git-fs-repo":"0.0.1","git-transport-protocol":"0.1.0","git-walk-refs":"0.0.1"},"bugs":{"url":"https://github.com/chrisdickinson/git-fetch-pack/issues"},"homepage":"https://github.com/chrisdickinson/git-fetch-pack","_id":"git-fetch-pack@0.1.1","dist":{"shasum":"7703a32cf0db80f060d2766a34ac00d02cebcdf5","tarball":"https://registry.npmjs.org/git-fetch-pack/-/git-fetch-pack-0.1.1.tgz","integrity":"sha512-B0frGXKWSVuq6e99mzeFkK33CMpsDTQQkC7FXKl5CkUBeCd9g0EUtZIj6zA73KmcUrHCwgo18wneZrJGZF4s4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5RLHCZEcAmRMxqFx7DCyvzSkYZRITbhfOkp4ujKV6ugIhAITOuVQHpIrutmnpapQaxlQ85EGxYO6oTobQ9sLVpSti"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":"chris@neversaw.us"}]}},"readme":"# git-fetch-pack\n\ngit's smart fetch pack protocol (the one that\ncalls `upload-pack` on the server).\n\ncan be used to download packfiles (fetch or clone!) or to list remote branches.\n\n```javascript\nvar net = require('net')\n  , fs = require('fs')\n\nvar gitclient = require('git-fetch-pack')()\n  , transport = require('git-transport-protocol')\n  , load = require('git-fs-repo')\n  , walk = require('git-walk-refs')\n\nload('/path/to/repo/.git', function(err, git) {\n  var refs = git.refs()\n    , hashes = refs.map(function(x) { return x.hash })\n    , tcp = net.connect({host: 'github.com', port: 9418})\n    , client\n\n  // given a want(ref, ready) function and a stream\n  // of all of the commits the repo has in reverse\n  // chronological order, we can negotiate a sweet\n  // packfile from the remote!\n  function want(ref, ready) {\n    if(ref.name === 'refs/heads/master') {\n      return ready(true)\n    }\n    return ready(false)\n  }\n  client = gitclient(\n      'git://github.com/chrisdickinson/plate.git'\n    , want\n    , walk(git.find, hashes)\n  )\n \n  // output ref data from the remote server! `refs`\n  // is a readable stream. \n  client.refs.on('data', console.log)\n\n  // pipe client to the transport and back to client.\n  client\n    .pipe(transport(tcp))\n    .pipe(client)\n\n  // when we get packfile data, it'll come out of this\n  // readable stream.\n  client.pack.pipe(fs.createWriteStream('client-output'))\n})\n```\n\n## API\n\n#### client(hostinfo[, want_function][, have_stream][, capabilities]) -> client duplex stream\n\ncreate a client for communicating with `hostinfo` that uses `want_function`\nto determine which branches to ask for, and can provide a list of already-present\ncommits using `have_stream`.\n\nby providing the `want_function` argument (which takes a `ref` object and a `ready` callback) but no others, you may emulate a `git clone`.\n\nby additionally providing a `have_stream` (usually using [git-walk-refs](http://npm.im/git-walk-refs)), you can emulate a `git fetch`.\n\nby providing `capabilities`, you enable the ability to blow your foot off, mostly; since by default this module does not support either side-band protocol.\n\n\n#### Ref objects\n\n```javascript\n{ \"hash\": \"git hash\"\n, \"name\": \"refs/heads/master\" // for example\n, \"commit\": null | \"hash\" }   // for annotated tags\n```\n\n#### `want_function`\n\n```javascript\nfunction want(ref, ready) {\n  // do you want this ref object?\n  ready(true) // sure do\n  ready() || ready(false) || ready('') // sure don't.\n}\n```\n\n#### stream.pack\n\nA readable stream of packfile data.\n\n#### stream.refs\n\nA readable stream of remote references.\n\n## License\n\nMIT\n","maintainers":[{"name":"chrisdickinson","email":"chris@neversaw.us"}],"time":{"modified":"2022-06-18T08:28:31.754Z","created":"2013-03-24T07:57:14.668Z","0.0.1":"2013-03-24T07:57:15.841Z","0.0.2":"2013-05-04T23:46:05.324Z","0.0.3":"2013-05-06T00:14:55.875Z","0.1.0":"2014-05-14T07:14:05.078Z","0.1.1":"2014-05-14T07:16:40.645Z"},"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/git-fetch-pack.git"},"homepage":"https://github.com/chrisdickinson/git-fetch-pack","keywords":["git","smart","clone","fetch","protocol"],"bugs":{"url":"https://github.com/chrisdickinson/git-fetch-pack/issues"},"license":"MIT","readmeFilename":"README.md"}