0.0.1 • Published 3 years ago
praseodymium v0.0.1
Praseodymium
Use .properties files in Node.js
Installation
npm i praseodymiumAPI
Initialize
Initialize by calling new propertiesReader(). ECMAScript import is also supported.
const propertiesReader = require('praseodymium')
const Reader = new propertiesReader('/file/path', { separatedBy:"=" })| Parameter | Description |
|---|---|
| File | The file path to read |
| advanced.separatedBy | Change what key/values are separated by (default: =) |
Get values
Get one
Reader.get('key')| Parameter | Description |
|---|---|
| key | The key to get the value of |
Get all
Reader.getAll()Get raw content as a string
Reader.getRaw()Set value
Reader.set('key','value')| Parameter | Description |
|---|---|
| key | The key to set the value of |
Convert
Convert to JSON
Reader.toJSON()Convert to an Array
Reader.toArray()Convert a JSON object to the .properties file syntax
Reader.toProperties({ key:"value" }, "output")| Parameter | Description |
|---|---|
| source | Object to convert |
| output | Path to output file (optional) |
Other info
Need help? Ask a question on Github
Report feedback & bugs here
Like our work? Support us on Patreon