properties-reader
Advanced tools
Comparing version 1.0.0 to 2.0.0
{ | ||
"name": "properties-reader", | ||
"description": "Properties file reader for Node.js", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"author": { | ||
@@ -38,3 +38,3 @@ "name": "Steve King", | ||
}, | ||
"main": "src/PropertiesReader", | ||
"main": "src/properties-reader-factory", | ||
"files": [ | ||
@@ -41,0 +41,0 @@ "src/**/*.js" |
@@ -13,5 +13,2 @@ Properties-Reader | ||
Or clone the repo [git clone https://github.com/steveukx/properties](https://github.com/steveukx/properties) and | ||
import the `/src/PropertiesReader.js` script. | ||
API | ||
@@ -22,4 +19,4 @@ === | ||
var PropertiesReader = require('properties-reader'); | ||
var properties = PropertiesReader('/path/to/properties.file'); | ||
var propertiesReader = require('properties-reader'); | ||
var properties = propertiesReader('/path/to/properties.file'); | ||
@@ -78,11 +75,9 @@ The properties are then accessible either by fully qualified name, or if the property names are in dot-delimited | ||
``` | ||
```javascript | ||
// async/await ES6 | ||
const props = new PropertiesReader(filePath); | ||
const propertiesReader = require('properties-reader'); | ||
const props = propertiesReader(filePath); | ||
await props.save(filePath); | ||
// tradtitonal | ||
const props = new PropertiesReader(filePath); | ||
// ES5 callback style | ||
// ES5 callback styles | ||
props.save(filePath, function then(err, data) { ... }); | ||
@@ -92,6 +87,4 @@ | ||
props.save(filePath).then(onSaved, onSaveError); | ||
``` | ||
Data Types | ||
@@ -103,2 +96,19 @@ ========== | ||
FAQ / Breaking Changes | ||
====================== | ||
## Duplicate Section Headings | ||
From version `2.0.0` the default behaviour relating to multiple `[section]` blocks with the same name has changed | ||
so combine the items of each same-named section into the one section. This is only visible when saving the items | ||
(via `reader.save()`). | ||
To restore the previous behaviour which would allow duplicate `[...]` blocks to be created, supply an appender | ||
configuration with the property `allowDuplicateSections` set to `true`. | ||
```javascript | ||
const propertiesReader = require('properties-reader'); | ||
const props = propertiesReader(filePath, 'utf-8', { allowDuplicateSections: true }); | ||
``` | ||
Contributions | ||
@@ -105,0 +115,0 @@ ============= |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17893
6
377
114
1