Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

gh-canonical-repository

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh-canonical-repository

Get the canonical GitHub repository of a git clone

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
4
-20%
Maintainers
1
Weekly downloads
 
Created
Source

gh-canonical-repository

Get the canonical GitHub repository of a git clone.

Calls back with the repository name it read from the local git config first, then with what it resolved via the public GitHub Api.

Use this for cases where you cloned a repository like Level/leveldown with lowercase level but need its actual name.

Example

const canonical = require('gh-canonical-repository')

canonical(
  process.argv[2],
  (err, guess) => {
    if (err) throw err
    console.log('guess', guess)
  },
  (err, repo) => {
    if (err) throw err
    console.log('repo', repo)
  }
)
$ node example.js ~/dev/level/leveldown
guess [ 'level', 'leveldown' ]
repo [ 'Level', 'leveldown' ]

Installation

$ npm install gh-canonical-repository

API

canonical(dir[, onGuess], cb)

canonical.promise(dir)

License

MIT

FAQs

Package last updated on 02 May 2017

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