node-intl
v1.1.1
Published
[![Build Status](https://travis-ci.org/igogo5yo/node-intl.svg?branch=master)](https://travis-ci.org/igogo5yo/node-intl) [![NPM](https://img.shields.io/npm/dt/node-intl.svg "NPM package downloads")](https://www.npmjs.com/package/node-intl) [![NPM](https://
Downloads
10
Readme
NodeIntl
This library give you simple interface to work with intl.js and intl-messageformat.
Usage
Install the package via NPM: npm i node-intl
.
const intl = NodeIntl.instance; // Create instance
intl.locale = 'ru-RU'; // set locale
intl.messages = {...}; // set messages
intl.addMessages({...}); // add new messages
intl.addMessagesFromFile('path/to/file'); // add new messages from file
intl.formatMessage('device.name', {prop: 'Name'}); // format messages