Checks JSON files within a path for duplicate keys and if all files within the same sub directory have the same keys - Grunt Wrapper
This plugin requires Grunt ~1.0.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 how to install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with the following command:
npm install grunt-compare_json --save-dev
Once the plugin has bee installed, it can be enabled within your Gruntfile by adding the following line of JavaScript:
grunt.loadNpmTasks('grunt-compare_json');
In your projects Gruntfile, add a section named compare_json
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
compare_json: {
src: ['./path/of/your/json/']
}
});
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.