grunt-cloc

CLOC launch utility.

Usage no npm install needed!

<script type="module">
  import gruntCloc from 'https://cdn.skypack.dev/grunt-cloc';
</script>

README

grunt-cloc

cloc launch utility.

Cloc tool is hosted at https://github.com/AlDanial/cloc.

Getting Started

This plugin requires Grunt.

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

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

grunt.loadNpmTasks('grunt-cloc');

The "cloc" task

Overview

In your project's Gruntfile, add a section named cloc to the data object passed into grunt.initConfig(). The section cloc may contain one or more targets.

grunt.initConfig({
    cloc: {
        target: {
            options: [
                // options go there
            ],
            src: [
                // filepaths go there
            ]
        },
        another_target: {
            options: [
                // options go there
            ],
            src: [
                // filepaths go there
            ]
        }
    }
});

Options

See CLOC documentation.

Usage Example

grunt.initConfig({
    cloc: {
        without_html_css: {
            options: ["--exclude-lang=HTML,CSS", "--exclude-dir=node_modules"],
            src: ["."]
        },
        without_html: {
            options: ["--exclude-lang=HTML"],
            src: ["."]
        }
    }
});

Release History

  • 0.0.1 First release.
  • 0.0.2 package.json fixed.

License

Copyright (c) 2015 B. Djoudi. Licensed under the MIT license.