🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

properties-to-object

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

properties-to-object - npm Package Compare versions

Comparing version

to
1.0.1

8

package.json
{
"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)
});
```