Code coverage report for stylus-lint/src/version.js

Statements: 83.33% (5 / 6)      Branches: 50% (1 / 2)      Functions: 100% (2 / 2)      Lines: 100% (5 / 5)      Ignored: none     

All files » stylus-lint/src/ » version.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15    1         1 1   1 1      
'use strict';
 
var
    fs = require('fs'),
    chalk = require('chalk');
 
// called when --version or -v flags used, just displays version number
module.exports = function version( app ) {
    return fs.readFile('package.json',
        function( err, data ) {
            Iif ( err ) { throw err; }
            return console.log( chalk.blue('\nStylint version: '), JSON.parse( data ).version, '\n' );
        }
    );
}