grunt-properties
Convert java .properties files to javascript
"JavaScript isn't a great way to store configuration data. That's because the syntax is still that of a programming language, so you need to be sure you haven't introduced syntax errors. If you end up concatenating JavaScript files together, a syntax error in a single line breaks the overall application" ( Nicholas C. Zakas, Maintainable JavaScript, Writing Readable Code, O'Reilly Media, May 2012)
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-properties --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "properties" task
Overview
In your project's Gruntfile, add a section named properties
to the data object passed into grunt.initConfig()
.
grunt
Options
options.namespace
Type: String
Default value: 'config'
Use a previously defined namespace.
Usage Examples
Default namespace config
grunt
Customized namespace
grunt
Contributing
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.
Release History
- 2013-05-22 v0.1.0 Initial release.
Credits
- node-properties-parser
- The awesome project props2js.