property-resolver-js
is a Node.js module, which provides 1 function, resolve
.
Github: https://github.com/thejeff77/property-resolver.git
MIT
npm install property-resolver-js
var resolver = require("property-resolver-js");
var jsonProps = {
A:'${B.foo}'
B: {
foo: 'bar'
}
};
var resolvedJsonProps = resolver.resolve(jsonProps, "${", "}", ".");
Result (resolvedJsonProps):
{
A:'bar'
B: {
foo: 'bar'
}
};
When using the resolver, properties that are not found will be turned into ???.
- The json properties structure
- The property prefix
- The property suffix
- The delimeter for property placeholder resolution. Ex: ${var1.var2.var3} would have a delimiter of ".".
- Currently does not support JSON arrays, as these aren't common when converting java *.properties files to json.