npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cli-git.io

v1.0.1

Published

shorten and unshorten GitHub.com URL

Downloads

25

Readme

cli-git.io License: MIT

shorten and unshorten GitHub.com URL.

Installation

npm install -g cli-git.io or npm install --save cli-git.io.

Usage

Globally installed (CLI)

gitio [ [-v|--version] | [-h|--help] | [ shorten [--check|-c]|unshorten <url> ]

Examples

Help information
$ gitio -h 
Usage: gitio [ [-v|--version] | [-h|--help] |  [ shorten [--check|-c]|unshorten  <url> ] ]
Version
$ gitio --version
1.0.0
Shorten a github URL
  1. Ignore the validity of the URL
$ gitio shorten "https://github.com/Gyumeijie/cli-git.io"
https://git.io/fx2Bg

$ gitio shorten "https://github.com/Gyumeijie/non-existent-repo"
https://git.io/fx2B9
  1. Check the validity of the URL
$ gitio shorten -c "https://github.com/Gyumeijie/non-existent-repo"
Warning: https://github.com/Gyumeijie/non-existent-repo is not reachable!
https://git.io/fx2B9

$ gitio shorten "https://github.com/Gyumeijie/non-existent-repo" -c
Warning: https://github.com/Gyumeijie/non-existent-repo is not reachable!
https://git.io/fx2B9
Unshorten a short URL
$ gitio unshorten https://git.io/fx2B9
https://github.com/Gyumeijie/non-existent-repo

$ gitio unshorten https://git.io/bad-path

Notice: Woops! We can't seem to unshorten that URL, this could be for a few reasons:

1. it may not be a short URL in the first place;
2. it may not be a real URL or could no longer be active;
3. it may not be a short URL compatible with git.io!

Locally installed (APIs)

const githubURL = require('cli-git.io');

Examples

Shorten a github URL
shorten(rawURL, callback, check);
  1. Outputs result to stdout:
githubURL.shorten('https://github.com/Gyumeijie/cli-git.io');
  1. Pass the result to a callback:
githubURL.shorten('https://github.com/Gyumeijie/cli-git.io', function(shortURL) {
  // do some thing with the shorten URL here
});
  1. Check the validity of rawURL
githubURL.shorten('https://github.com/Gyumeijie/cli-git.io',undefined, true);
Unshorten a short URL
  1. Outputs result to stdout:
githubURL.unshorten('unshorten https://git.io/fx2B9');
  1. Pass the result to a callback:
githubURL.unshorten('unshorten https://git.io/fx2B9', function(rawURL) {
  // do some thing with the unshorten URL here
});

The GitHub.com URLs

The following are part of URLs which can be shorten or unshorten by cli-git.io:

  • https://help.github.com
  • https://guides.github.com
  • https://gist.github.com
  • https://raw.githubusercontent.com
  • https://page.github.com
  • https://developer.github.com
  • https://user.github.io