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

grunt-npm-check-updates

v1.1.2

Published

A Grunt Task that checks the update capabilities for each installed modules (without their dependencies).

Downloads

16

Readme

GitHub version npm version Build Status Dependencies GitHub issues GitHub stars GitHub forks GitHub license Built with Grunt

grunt-npm-check-updates

A Grunt Task that checks the update capabilities for each installed modules (without their dependencies).

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-npm-check-updates --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-npm-check-updates');

The "grunt-npm-check-updates" task

Example output

./screenshot.jpeg

Overview

In your project's Gruntfile, add a section named grunt-npm-check-updates to the data object passed into grunt.initConfig().

grunt.initConfig({
  'grunt-npm-check-updates': {
    include: {
        production: true,
        develop: true,
        optional: false,
        jsonFile: 'package.json',
    },
    output: {
        visual: true,
        xml: true,
        xmlFilename: 'grunt-npm-check-updates.xml',
        xmlTemplate: '<?xml version="1.0"?><modules>{{#each modules}}<module name="{{{ this.name }}}" installed="{{{ this.installed }}}" latest="{{{ this.latest }}}" missedMajors="{{{ this.missedMajors }}}" missedMinors="{{{ this.missedMinors }}}" missedPatches="{{{ this.missedPatches }}}" status="{{{ this.status }}}"><versions>{{{ this.versions }}}</versions></module>{{/each}}</modules>',
        json: true,
        jsonFilename: 'grunt-npm-check-updates.json',
        jsonTemplate: '{"modules": [{{#each modules}}{{#if @last }}{"name": "{{{ this.name }}}","installed": "{{{ this.installed }}}","latest": "{{{ this.latest }}}","missedMajors": "{{{ this.missedMajors }}}","missedMinors": "{{{ this.missedMinors }}}","missedPatches": "{{{ this.missedPatches }}}","versions": "{{{ this.versions }}}","status": "{{{ this.status }}}"}{{else}}{"name": "{{{ this.name }}}","installed": "{{{ this.installed }}}","latest": "{{{ this.latest }}}","missedMajors": "{{{ this.missedMajors }}}","missedMinors": "{{{ this.missedMinors }}}","missedPatches": "{{{ this.missedPatches }}}","versions": "{{{ this.versions }}}","status": "{{{ this.status }}}"},{{/if}}{{/each}}]}',
    },
    global: {
        missedMajors: {
            allowed: 0,
            level: 'error',
        },
        missedMinors: {
            allowed: 1,
            level: 'warn',
        },
        missedPatches: {
            allowed: 0,
            level: 'warn',
        },
        showVersions: false,
    },
    modules: {}
});

Task Options

include.jsonFile

Type: String Default value: package.json

The path of the package.json.

include.production

Type: Boolean Default value: true

Indicates whether the dependencies should be included in the test.

include.development

Type: Boolean Default value: true

Indicates whether the devDependencies should be included in the test.

include.optional

Type: Boolean Default value: true

Indicates whether the optionalDependencies should be included in the test.

output.visual

Type: Boolean Default value: true

Indicates whether the result of the tests should be printed to the console.

output.xml

Type: Boolean Default value: true

Indicates whether the result of the tests should be written to a xml file.

output.xmlFilename

Type: String Default value: npm-check-updates.xml

The filename for the options.xml option.

output.xmlTemplate

Type: String Default value: <?xml version="1.0"?><modules>{{#each modules}}<module name="{{{ this.name }}}" installed="{{{ this.installed }}}" latest="{{{ this.latest }}}" missedMajors="{{{ this.missedMajors }}}" missedMinors="{{{ this.missedMinors }}}" missedPatches="{{{ this.missedPatches }}}" status="{{{ this.status }}}"><versions>{{{ this.versions }}}</versions></module>{{/each}}</modules>

The Handlebars template for the XML file output.

output.json

Type: Boolean Default value: true

Indicates whether the result of the tests should be written to a json file.

output.jsonFilename

Type: String Default value: npm-check-updates.json

The filename for the options.json option.

output.jsonTemplate

Type: String Default value: {"modules": [{{#each modules}}{{#if @last }}{"name": "{{{ this.name }}}","installed": "{{{ this.installed }}}","latest": "{{{ this.latest }}}","missedMajors": "{{{ this.missedMajors }}}","missedMinors": "{{{ this.missedMinors }}}","missedPatches": "{{{ this.missedPatches }}}","versions": "{{{ this.versions }}}","status": "{{{ this.status }}}"}{{else}}{"name": "{{{ this.name }}}","installed": "{{{ this.installed }}}","latest": "{{{ this.latest }}}","missedMajors": "{{{ this.missedMajors }}}","missedMinors": "{{{ this.missedMinors }}}","missedPatches": "{{{ this.missedPatches }}}","versions": "{{{ this.versions }}}","status": "{{{ this.status }}}"},{{/if}}{{/each}}]}

The Handlebars template for the JSON file output.

Global Test Options

global.missedMajors

Type: Object Default value: missedMajors: {allowed: false, level: 'error'}

Defines the allowed (or not allowed) missed major releases.

global.missedMajors.allowed

Type: Integer|Boolean Default value: 0

Indicates the count of missed majors updates which could pass the test. Set to true to allow infinite missed majors updates.

global.missedMajors.level

Type: String Default value: error Allowed values: error, warn, debug

Indicates how cirital a missed major update is. error means that the Grunt Task will fail. warn means that the Grunt Task will only warn. debug mean that the Task will only with --debug flag output some text.

global.missedMinors

Type: Object Default value: missedMinors: {allowed: false, level: 'error'}

Defines the allowed (or not allowed) missed minor releases.

global.missedMinors.allowed

Type: Integer|Boolean Default value: 0

Indicates the count of missed minors updates which could pass the test. Set to true to allow infinite missed minors updates.

global.missedMinors.level

Type: String Default value: error Allowed values: error, warn, debug

Indicates how cirital a missed minor update is. error means that the Grunt Task will fail. warn means that the Grunt Task will only warn. debug mean that the Task will only with --debug flag output some text.

global.missedPatches

Type: Object Default value: missedPatches: {allowed: false, level: 'error'}

Defines the allowed (or not allowed) missed patch releases.

global.missedPatches.allowed

Type: Integer|Boolean Default value: 0

Indicates the count of missed patch updates which could pass the test. Set to true to allow infinite missed patch updates.

global.missedPatches.level

Type: String Default value: error Allowed values: error, warn, debug

Indicates how cirital a missed patch update is. error means that the Grunt Task will fail. warn means that the Grunt Task will only warn. debug mean that the Task will only with --debug flag output some text.

global.showVersions

Type: Boolean Default value: false

Indicates the whether the XML output or the console output should display the version history of a module.

Module specific Test Options

See the Global Test Options. Just wrap the options into an object with the name of the npm module as key.

modules: {
    grunt: {
        missedMajors: {
            ...
        }
    }
}

Release History

1.1.2

  • fixed issue https://github.com/pixel-shock/grunt-npm-check-updates/issues/2 ** thanks to Matthew Mitchell (https://github.com/mmitchell80)
  • fixed issue https://github.com/pixel-shock/grunt-npm-check-updates/issues/1 ** thanks to Matthew Mitchell (https://github.com/mmitchell80)
  • switched to yarn

1.1.1

  • fixed typo for "jsonFileName" to "jsonFilename"

1.1.0

  • removed XMLWriter package
  • added Handelbars package
  • add XML Handlebars Template option
  • add JSON Handlebars Template option

1.0.0

  • moved Helper.js & Comparator.js into "lib" dir
  • removed Progressbar
  • changed graphical output

0.1.3

  • upgraded required node version

0.1.2

  • refactored code
  • added tests

0.1.1

  • changed options to be more distinct
  • fixed --debug flag identification for task

0.1.0

  • first release

TODO

  • add more tests (if necessary)