1. grunt-jsmeter
Grunt plugin to run jsmeter to get metrics out of the code quality
grunt-jsmeter
Package: grunt-jsmeter
Created by: joseph-jja
Last modified: Sat, 18 Jun 2022 15:20:08 GMT
Version: 0.3.1
License: GPL
Downloads: 23
Repository: https://github.com/joseph-jja/grunt-jsmeter

Install

npm install grunt-jsmeter
yarn add grunt-jsmeter

grunt-jsmeter

Grunt plugin to run jsmeter to get metrics out of the code quality ( jsmeter can be found https://code.google.com/p/jsmeter/ ). This is a grunt plugin to enable generating reports out of the jsmeter npm module.

Getting Started

This plugin requires Grunt ~0.4.1

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

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

 grunt.loadNpmTasks('grunt-jsmeter');

The "jsmeter" task

Overview

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

 grunt.initConfig({
  jsmeter: {
    options: {
      // Task-specific options go here.
    },
  },
})

Files

files.src

Type: Array
Default value: []

An array of files.

Options

options.dest

Type: String
Default value: 'log'

A string value that is used to identify the location output.
The default is log, but if the console render is used then this does nothing.

options.engine

Type: String
Default value: 'console'

A string value that is used to identify the engine to render the output.
The default is console. Alternative renders available are LogRender.

options.template

Type: String
Default value: 'none'

A string value that is used to identify the handlebars template that should be used
to render each page. The default template is templates/page.hbs.

options.indexTemplate

Type: String
Default value: 'none'

A string value that is used to identify the handlebars template that should be used
to render each page. The default template is templates/index.hbs.

Usage Examples

Default Options

In this example, the default options are used to do something with whatever.
So if the testing file has the content Testing and the 123 file had the content 1 2 3, the generated result would be Testing, 1 2 3.

 grunt.initConfig({
  jsmeter: {
    files: {
      src: ['src/testing', 'src/123'],
    },
  },
})

Custom Options

In this example, custom options are used to do something else with whatever else. So if the testing file has the content Testing and the 123 file had the content 1 2 3, the generated result in this case would be Testing: 1 2 3 !!!

 grunt.initConfig({
  jsmeter: {
    files: {
      src: ['src/testing', 'src/123'],
    },
    options: {
      dest: 'logs',
      engine: 'LogRender',
    },
  },
})

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style.
This project uses jshint and jasmine node tests.
Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code