0.0.6 • Published 1 year ago

git-clone-client v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

git-clone-client

No dependency, no file-system Git shallow clone client for Node.js

import { shallowCloneRef, httpFetchUsing } from 'git-clone-client';

async function handleRequest(req, res) {
    const files = await shallowCloneRef('refs/heads/main', {
        // Provide fetching method
        makeRequest: fetchRepository('https://github.com/probeiuscorp/git-clone-client.git'),
        // Partial clone -- only fetch files in the src/ directory
        filter: (filepath) => filepath.startsWith('src/'),
    });
}
// Use conveniently provided HTTP util, in this case with your environment's fetch method.
// Write your own to request over git://, ssh:// or whatever!
const fetchRepository = httpFetchUsing(fetch);

!NOTE This package uses node:zlib, node:crypto and node:buffer. To use different packages, fork and change imports of src/git-objects.ts.

0.0.6

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.1

1 year ago