Export ini files to a global JS object
This plugin requires Grunt ~0.4.2
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-ini-export --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-ini-export');
In your project's Gruntfile, add a section named ini_export
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
ini_export: {
options: {},
files: ['test/fixtures/*.ini'],
}
});
Type: String
Default value: 'tmp/config.js'
A filepath to write to..
Type: String
Default value: 'Bootstrap'
Namespace is required. An object will be created with this namespace and also nested with the filename
Type: Array
An array of key->val options to swap/ rename keys if needed
Type: Array
An array of string values to remove from object naming.
Type: Array
An array of string values to exclude exporting certain keys.
grunt.initConfig({
ini_export: {
files: ['test/fixtures/*.ini'],
options: {
outfile: 'tmp/config.js',
namespace: 'APP',
swapKeys: [{
'route' : 'path'
}],
deleteKeys: ['defaults'],
exclude: ['routes', 'type', 'action']
}
},
},
});
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.
(Nothing yet)