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



NPM version Dependency Status Downloads counter

Get statistics about files in project (lines, characters, …)

Getting Started

This plugin requires Grunt ~0.4

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-statistiks --save-dev

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


The "statistiks" task

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

The "statistiks" task is coded to be used as MultiTask or as a simple task : if you don't define it in your grunt config, calling grunt statistiks will use the default options.

Minimal usage

The minimal usage of grunt-statistics will returns you the count of folders, files, non-empty lines and characters (from trimmed lines).

statistiks: {
  src: [

Usage with all available options

statistiks: {
  options: {
    countEmptyLines: false,
    trimLines: true,
    countFolders: false
  src: [


If you omit target files, grunt-statistiks will use all the files in the project, excepting the files in node_modules folder.



Type: Boolean
Default: false

Set to true to count empty lines in total lines count.


Type: Boolean
Default: true

By default, all non-empty lines are trimmed before characters counting. Set to false to avoid trim.


Type: Boolean
Default: false

Set to true to count folders.


In lieu of a formal styleguide, take care to maintain the existing coding style.
Lint and test your code using Grunt.

Release History

  • 2014/07/05 : 0.2.0 (allow task to be runned as simple or multi task)
  • 2014/06/21 : 0.1.0 (first release)


  • Add an option to reject binary files from counting
  • Add an option to reject comment from code-files


Copyright (c) 2014 Leny
Licensed under the MIT license.