Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8412099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:35:29+00:00 2026-06-10T00:35:29+00:00

As my node.js application is a command line application that is run by the

  • 0

As my node.js application is a command line application that is run by the user directly. It would make sense for it to phone the github repo and compare its local version against the lastest on the master branch on the github repo. And if the version is outdated, display a message to the user.

So how would one accomplish this phone home and compare versions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:35:31+00:00Added an answer on June 10, 2026 at 12:35 am

    Created a solution to do this myself. Requires the dependency bal-util (so npm install bal-util). Here’s the code:

    Source code of the packageCompare function can be found here: https://github.com/balupton/bal-util/blob/master/src/lib/compare.coffee

    CoffeeScript

    # Prepare
    balUtil = require('bal-util')
    pathUtil = require('path')
    debug = false
    
    # Compare
    balUtil.packageCompare({
        local: pathUtil.join(__dirname, '..', 'package.json')
        remote: 'https://raw.github.com/bevry/docpad/master/package.json'
        newVersionCallback: (details) ->
            if debug
                console.log """
                    There is a new version of #{details.local.name} available, you should probably upgrade...
                    current version:  #{details.local.version}
                    new version:      #{details.remote.version}
                    grab it here:     #{details.remote.homepage}
                    """
            else
                console.log "There is a new version of #{details.local.name} available"
    })
    

    JavaScript

    // Prepare
    var balUtil, debug, pathUtil;
    balUtil = require('bal-util');
    pathUtil = require('path');
    debug = false;
    
    // Compare
    balUtil.packageCompare({
      local: pathUtil.join(__dirname, '..', 'package.json'),
      remote: 'https://raw.github.com/bevry/docpad/master/package.json',
      newVersionCallback: function(details) {
        if (debug) {
          return console.log("There is a new version of " + details.local.name + " available, you should probably upgrade...\ncurrent version:  " + details.local.version + "\nnew version:      " + details.remote.version + "\ngrab it here:     " + details.remote.homepage);
        } else {
          return console.log("There is a new version of " + details.local.name + " available");
        }
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to run my node.js application without the automatic logs it prints
I have a node application that is not a web application - it completes
I am currently profiling my node.js application.I found this blog: http://blog.nodejs.org/2012/04/25/profiling-node-js/ that suggests I
I'm working on a test harness that interacts with another node application and verifies
NetFoss requires you to run it with a command line similar to this: nf.bat
I would like be able to run a single command in my project folder
I have a running erlang application, launched with this command line erl -boot start_sasl
I'm trying to upgrade my Node application from 0.4 to 0.6 along with all
I'm trying to debug a memory leak in a Node.js application but cannot install
I am trying to link up a redis database with a Node.js application I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.