gitly
An API to download and/or extract git repositories.
This project is the spiritual successor of gittar written in TypeScript.
Usage
import { fetch, extract } = from 'gitly'
console.log(await fetch('iwatakeshi/gitly'))
console.log(await fetch('iwatakeshi/gitly#v1.0.0'))
console.log(await fetch('https://github.com/iwatakeshi/gitly'))
console.log(await fetch('gitlab:Rich-Harris/buble#v0.15.2'))
console.log(await fetch('Rich-Harris/buble', { host: 'gitlab' }))
const source = '...local file or repo pattern to the local file...'
const dest = '/path/to/foobar'
await extract(source, destination)
Options
interface GitlyOptions {
cache?: boolean
force?: boolean
temp?: string
host?: string
url?: {
filter?(info: URLInfo): string
}
extract?: {
filter?(path: string, stat: FileStat): boolean
}
}
Interfaces
interface URLInfo {
protocol: string
host: string
hostname: string
hash: string
href: string
path: string
repository: string
owner: string
type: string
}