Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gitly

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitly

An API to download and/or extract git repositories

  • 1.1.0-0
  • next
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5K
increased by23.8%
Maintainers
1
Weekly downloads
 
Created
Source

gitly

An API to download and/or extract git repositories.

Node CI Version Downloads/week License

This project is the spiritual successor of gittar written in TypeScript.

Usage

import { fetch, extract } = from 'gitly'

console.log(await fetch('iwatakeshi/gitly'))
// -> ~/.gitly/github/iwatakeshi/gitly/master.tar.gz

console.log(await fetch('iwatakeshi/gitly#v1.0.0'))
// -> ~/.gitly/github/iwatakeshi/gitly/v1.0.0.tar.gz

console.log(await fetch('https://github.com/iwatakeshi/gitly'))
// -> ~/.gitly/github/iwatakeshi/gitly/master.tar.gz

console.log(await fetch('gitlab:Rich-Harris/buble#v0.15.2'))
// -> ~/.gitly/gitlab/Rich-Harris/buble/v0.15.2.tar.gz

console.log(await fetch('Rich-Harris/buble', { host: 'gitlab' }))
// -> ~/.gitly/gitlab/Rich-Harris/buble/master.tar.gz

const source = '...local file or repo pattern to the local file...'
const dest = '/path/to/foobar'

await extract(source, destination)
// -> /path/to/foobar

Options

interface GitlyOptions {
  // Use cache only
  cache?: boolean
  // Use both cache and local
  force?: boolean
  // Set cache directory
  temp?: string
  // Set the host name
  host?: string
  url?: {
    // Extend the url filtering method
    filter?(info: URLInfo): string
  }
  extract?: {
    // Extend the extract filtering method
    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
}

Keywords

FAQs

Package last updated on 17 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc