grunt-csv2json v0.1.5
grunt-csv2json
Turn CSVs into JSON using the Grunt CLI
Getting Started
This plugin requires Grunt ~0.4.5
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-csv2json --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-csv2json');
The "CSV2JSON" task
Overview
In your project's Gruntfile, add a section named csv2json
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
csv2json: {
options: {
inputFilePath: 'csv',
outputFilePath: 'json'
}
}
});
Options
options.inputFilePath
Type: String
Default value: 'csv'
A string value that points to the directory where your .csv file is.
options.outputFilePath
Type: String
Default value: 'json'
A string value that points to where your .json file will be output.
Usage Examples
grunt csv2json:sample
will look for a .csv file named sample
in the specified csv directory and automatically generate a corresponding JSON file in the specified JSON directory.
Release History
(Nothing yet)