properties-to-object
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "properties-to-object", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Parse property file structures into object structures", | ||
@@ -18,2 +18,6 @@ "main": "index.js", | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/winner-potential/properties-to-object.git" | ||
}, | ||
"license": "MIT", | ||
@@ -23,2 +27,2 @@ "devDependencies": { | ||
} | ||
} | ||
} |
# Parse Properties to Objects | ||
Simple parser to handle property file based key names and parse them into objects. | ||
Simple parser to handle property file based key names and parse them into objects. The key name separations with points is transferred into an object structure. | ||
@@ -16,2 +16,27 @@ ``` | ||
console.log(config.some.property); | ||
``` | ||
## Use with Spring Cloud Config | ||
This node module is intended to be used in combination with results from spring cloud configuration servers as provided by using the module [cloud-config-client](https://github.com/victorherraiz/cloud-config-client). | ||
``` | ||
npm install cloud-config-client properties-to-object --save | ||
``` | ||
``` javascript | ||
const client = require("cloud-config-client") | ||
const parser = require("properties-to-object") | ||
client.load({ | ||
application: "invoices" | ||
}).then((config) => { | ||
// Rebuild config from server into map with key value pairs | ||
var result = {} | ||
config.forEach((k,v) => { | ||
result[k] = v | ||
} | ||
// Use parser to create configuration object | ||
var configuration = parser(result) | ||
}); | ||
``` |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
5047
41
0