Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    github-avatarpublic

    github-avatar

    fetch the github avatar for a user

    example

    simple

    var avatar = require('github-avatar');
    var fs =  require('fs');
     
    avatar('substack').pipe(fs.createWriteStream('substack.jpg'));

    using leveldb for caching

    var avatar = require('github-avatar');
    var fs =  require('fs');
    var level = require('level');
     
    var img = avatar('substack', { db: level(__dirname + '/cache') });
    img.pipe(fs.createWriteStream('substack.jpg'));

    methods

    var avatar = require('github-avatar')

    var img = avatar(username, opts)

    Return a readable stream img of jpeg image data for the github user username.

    Optionally:

    • opts.db - a leveldb handle to use for caching
    • opts.size - size in pixels of the image to generate
    • opts.maxAge - how long in milliseconds to keep an image in the cache

    install

    With npm do:

    npm install github-avatar
    

    license

    MIT

    install

    npm i github-avatar

    Downloadsweekly downloads

    9

    version

    1.0.0

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar