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

githubby

v1.0.0-d

Published

Search GitHub for repositories, code and users. Get user/repo data.

Downloads

5

Readme

GitHubby uses request (simplified http request client) to fetch the contents of a GitHub page and then Cheerio (server side jQuery implementation) to parse the document.

Note: this is the first commit/version of package GitHubby. Currently proper error handling is on the todo list but right now the functions assume that you are not an idiot programmer and provide the proper arguments as described below.

Install it

Install GitHubby from the command line or download it from GitHub.

npm install GitHubby

Require it

Require it in your Node.js application.

var GitHubby = require('githubby');

Use it

This is a list of all methods.

getUser

Get the information of a single user.

GitHubby.getUser('jochemstoel', (data) => 
{
	console.log(data);
});

Response

{
    "name": "Jochem Stoel",
    "image": "https://avatars0.githubusercontent.com/u/4212360?v=3&s=400",
    "worksFor": "Jochem Stoel",
    "homeLocation": "Netherlands",
    "website": "http://jochemstoel.github.io/",
    "joined": "Apr 20, 2013"
}

getUserRepositories

Get a list of user repositories.

GitHubby.getUserRepositories('jochemstoel', (data) => 
{
	console.log(data);
});

Response

[
    {
        "href": "https://github.com/jochemstoel/php-ago",
        "text": "Convert the difference between a given timestamp and the present moment to human language."
    },
    {
        "href": "https://github.com/jochemstoel/google-search-suggestions",
        "text": "This PHP class will return 10 Google Search suggestions for any given language and phrase(s)"
    },
    {
        "href": "https://github.com/jochemstoel/jquery-bootstrap-contextmenu",
        "text": "Tiny right-mouseclick contextmenu for jQuery / Bootstrap."
    },

    ...etc etc
]

getUserFollowing

Get a list of all girls the user is following.

GitHubby.getUserFollowing('jochemstoel', (data) => 
{
	console.log(data);
});

Response

[
    {
        "name": "Morteza Milani",
        "url": "https://github.com/milani",
        "image": "https://avatars1.githubusercontent.com/u/508130?v=3&s=192"
    },
    {
        "name": "Sjoer van der Ploeg",
        "url": "https://github.com/sfjuocekr",
        "image": "https://avatars1.githubusercontent.com/u/398018?v=3&s=192"
    },
    {
        "name": "Erik Smit",
        "url": "https://github.com/erik-smit",
        "image": "https://avatars2.githubusercontent.com/u/1376121?v=3&s=192"
    },
    {
        "name": "Abe",
        "url": "https://github.com/abrahamkoshy",
        "image": "https://avatars3.githubusercontent.com/u/323375?v=3&s=192"
    },
    {
        "name": "Alan Hamlett",
        "url": "https://github.com/alanhamlett",
        "image": "https://avatars1.githubusercontent.com/u/522344?v=3&s=192"
    }
]

getUserFollowers

Get a list of all the stalkers who are following a user.

GitHubby.getUserFollowers('jochemstoel', (data) => 
{
	console.log(data);
});

Response

[
    {
        "name": "Sjoer van der Ploeg",
        "url": "/sfjuocekr",
        "image": "https://avatars1.githubusercontent.com/u/398018?v=3&s=192"
    },
    {
        "name": "Erik Smit",
        "url": "/erik-smit",
        "image": "https://avatars2.githubusercontent.com/u/1376121?v=3&s=192"
    },
    {
        "name": "Robin Prak",
        "url": "/SLKTH",
        "image": "https://avatars0.githubusercontent.com/u/11011399?v=3&s=192"
    }
]

searchRepositories

Search for GitHub repositories. Set the second parameter (language) to false if you want to search all languages but you have to provide something.

GitHubby.searchRepositories('electron', 'javascript', (data) => 
{
	console.log(data);
});

Response

[
    {
        "name": "electron",
        "href": "https://github.com//electron-userland/electron-packager",
        "owner": "electron-userland",
        "description": "Package and distribute your Electron app with OS-specific bundles (.app, .exe etc) via JS or CLI"
    },
    {
        "name": "electron",
        "href": "https://github.com//szwacz/electron-boilerplate",
        "owner": "szwacz",
        "description": "Boilerplate application for Electron runtime"
    },
    {
        "name": "electronic",
        "href": "https://github.com//geeeeeeeeek/electronic-wechat",
        "owner": "geeeeeeeeek",
        "description": "A better WeChat client on Mac OS X and Linux."
    },
    {
        "name": "electron",
        "href": "https://github.com//electron-userland/electron-prebuilt",
        "owner": "electron-userland",
        "description": "Install Electron (formerly atom-shell) prebuilts using npm"
    },

    ... etc etc
]

searchCode

Search code inside repositories. The second argument false means any language. Set to 'javascript' or 'c' or 'ruby' ...and so on.

GitHubby.searchCode('system.io.file', false, (data) => 
{
	console.log(data);
});

Response

[
    {
        "repository": "mp3infp",
        "owner": "k-takata",
        "file": "src/lib/mp4v2/libplatform/src/FileSystem.cpp",
        "href": "https://github.com/k-takata/mp3infp/blob/19e4a6643d5646d7eb20300914279fc16235f69a/src/lib/mp4v2/libplatform/src/FileSystem.cpp"
    },
    {
        "repository": "MissingFeatures.NET",
        "owner": "NikolayIT",
        "file": "MissingFeatures.Tests.Fakes/FakesAssemblies/mscorlib.Fakes.fakesconfig",
        "href": "https://github.com/NikolayIT/MissingFeatures.NET/blob/c06c4d60699b37da433845a9767ff2eedfd8f1c7/MissingFeatures.Tests.Fakes/FakesAssemblies/mscorlib.Fakes.fakesconfig"
    },
    {
        "repository": "strategoxt",
        "owner": "metaborg",
        "file": "strategoxt/stratego-libraries/lib/ssl-compat/io.str",
        "href": "https://github.com/metaborg/strategoxt/blob/bb586fe04a9e1f277ead402d08dad248392253ae/strategoxt/stratego-libraries/lib/ssl-compat/io.str"
    },
    
    ... etc etc
]

searchUsers

Use this method to search for users.

GitHubby.searchUsers('jochem', (data) => 
{
	console.log(data);
});

Response

[
    {
        "name": "Jochem Stoel",
        "image": "https://avatars0.githubusercontent.com/u/4212360?v=3&s=400",
        "worksFor": "Jochem Stoel",
        "homeLocation": "Netherlands",
        "website": "http://jochemstoel.github.io/",
        "joined": "Apr 20, 2013"
    }, 
    {
        "name": "Jochem Kossen",
        "image": "https://avatars1.githubusercontent.com/u/365837?v=3&s=400",
        "worksFor": "",
        "homeLocation": "Zwolle, NL",
        "website": "http://jkossen.nl",
        "joined": "Aug 16, 2010"
    },
    {
        "name": "Jochem",
        "image": "https://avatars1.githubusercontent.com/u/2325654?v=3&s=400",
        "worksFor": "",
        "homeLocation": "Utrecht, NL",
        "website": "",
        "joined": "Sep 11, 2012"
    },
    {
        "name": "Jochem Nabuurs",
        "image": "https://avatars0.githubusercontent.com/u/1541475?v=3&s=400",
        "worksFor": "Jaffiro (freelance webdevelopment)",
        "homeLocation": "Nijmegen, The Netherlands",
        "website": "http://www.jaffiro.nl",
        "joined": "Mar 15, 2012"
    },
    
    ... etc etc
]

Jochem Stoel

Involuntary public figure.