praseodymium

0.0.1 • Public • Published

Praseodymium

Use .properties files in Node.js

Installation

npm i praseodymium

API

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

/praseodymium/

    Package Sidebar

    Install

    npm i praseodymium

    Weekly Downloads

    0

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    5.07 kB

    Total Files

    3

    Last publish

    Collaborators

    • coolstone
    • systemsoftware
    • elementscript