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

ghc

v0.0.4

Published

Lazy GitHub clone: navigate files in CLI without a clone (tested in macOS).

Downloads

11

Readme

ghc

Lazy GitHub clone: navigate files in CLI without a clone (tested in macOS).

I use GitHub a lot and found it painful to browser files (on the web app) and also it's very slow to clone big repos. What I really want is just only download files I need. Octotree is a great extension for Chrome but I'd like to build a tool for CLI.

Ghc is a 2-hour hack. So, if you think it useful and want to help improving, feel free to submit an issue / question / PR. Thanks!

Install

Please ensure you have nodejs >= 6 and npm installed.

$ npm i ghc -g

Usage

Init & enter

$ ghc -i <username>/<repository> (master as default branch)
$ ghc -i <username>/<repository> -b <branch>

which will open a customized ghc shell. The shell supports very basic output format, highlight, autocomplete and command history.

Commands

$ ls [path]
$ cd <path>
$ cat <file>: download that file (and cat it)
$ subl <file>: download that file (and sublime it)
$ atom <file>: download that file (and atom it)

Exit

Exit the ghc shell.

$ exit

Other

Other instructions will fallback to execute in bash. i.e. pwd, tree, clear, etc.

Demo

~/temp
❯ ghc -i torvalds/linux
Initializing torvalds/linux#master...
OK
Initializing local cache...
OK

∆ torvalds/linux [master] 
> ls
.cocciconfig             .get_maintainer.ignore   .gitignore               
.mailmap                 COPYING                  CREDITS                  
Documentation            Kbuild                   Kconfig                  
MAINTAINERS              Makefile                 README                   
REPORTING-BUGS           arch                     block                    
...

∆ torvalds/linux [master] 
> cd kernel

∆ torvalds/linux [master] kernel
> ls
.gitignore               Kconfig.freezer          Kconfig.hz               
Kconfig.locks            Kconfig.preempt          Makefile                 
acct.c                   async.c                  audit.c                  
audit.h                  audit_fsnotify.c         audit_tree.c             
audit_watch.c            auditfilter.c            auditsc.c                
...

∆ torvalds/linux [master] kernel
> cat up.c
/*
 * Uniprocessor-only support functions.  The counterpart to kernel/smp.c
 */

#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/smp.h>

int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
        int wait)
{
  unsigned long flags;
...

∆ torvalds/linux [master] kernel
> exit

~/temp
❯ tree
.
└── torvalds_linux_master_ghc
    └── kernel
        └── up.c

2 directories, 1 file

License

2016, Shu Ding, MIT licensed.

<3