Package Exports
- java-properties
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (java-properties) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
java-properties
Read Java .properties files. Supports adding dynamically some files and array key value (same key multiple times)
Getting Started
Install the module with: npm install java-properties
Documentation
var properties = require('java-properties');
var values = properties.of('values.properties');
//Read a value from the properties file
values.get('a.key'); //returns value of a.key
//Add an additional file's properties
values.add('anotherfile.properties');
//Clear out all values
values.reset();
...
values.getKeys(); // returns all the keys
...
values.addFile('anotherFile.properties'); // adds another file the properties list
...
values.reset(); // empty the keys previously loaded
...
[ -- .properties file
an.array.key=value1
an.array.key=value2
]
values.get('an.array.key'); // returns [value1, value2]
// Since 0.2.0 : Multiple contexts
var myFile = new PropertiesFile('example.properties', 'arrayExample.properties');
myFile.get('arrayKey');
var myOtherFile = new PropertiesFile();
myOtherFile.addFile('example.properties');
myOtherFile.addFile('example2.properties');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
0.1.0 Initial commit
0.1.5: Support empty strings
0.1.6 New API: getKeys
0.1.7 New APIs: addFile and reset
0.1.8 Add array key (the same key many time in files)
0.2.0 Wrap features into a class to be able to have multiple running contexts
License
Licensed under the MIT license.