resource-file-reader

1.1.0 • Public • Published

Resource File Reader

Simple .properties files reader for NodeJS applications similar to salesforce b2c commercecloud dw Resource class.

Installation

npm install resource-file-reader

Methods Usage

msg

This method reads the value of the given property name from the specified bundle/.properties file, if no values found returns the default value.

const Resource = require('resource-file-reader');

Resource.msg('property.name', 'bundleName', defaultValue);

msgf

This method reads the value similar to msg method and replaces the placeholders ({0}, {1}...) with the arguments passed.

Resource.msgf('property.name', 'bundleName', defaultValue, ...args);

/resource-file-reader/

    Package Sidebar

    Install

    npm i resource-file-reader

    Weekly Downloads

    4

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    6.83 kB

    Total Files

    8

    Last publish

    Collaborators

    • arun_tamizh