Closed Andreas-Schoenefeldt closed 4 years ago
I would like to see that feature included, but for those of you that see this before it's included, this works well:
let lines = [];
properties.each((key, value) => {
lines.push(key + "=" + value);
});
fs.writeFileSync('/path/to/file.properties', lines.join('\n'));
That would be awesome to have as an option
Hi, apologies for the slow response to this - there is an option now available in version 2.1.1
on npm that adds this functionality:
const propertiesReader = require('properties-reader');
const props = propertiesReader(filePath, 'utf-8', { writer: { saveSections: false } });
await props.save(outputFilePath);
It works, thx a lot! 👍
Hi Guys,
my project is using the properties files for translations, but without sections. It would be great, if I could dissable the sections on write in a way.
I provided https://github.com/steveukx/properties/pull/24 for this - please review and merge at your convenience, if you deem this usefull.
Thx a lot! Andreas