Skip to content

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

License

Notifications You must be signed in to change notification settings

probeiuscorp/git-clone-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published