This library give you simple interface to work with intl.js and intl-messageformat.
Install the package via NPM: npm i node-intl
.
const intl = NodeIntl.instance; // Create instance
intl.locale = 'en-US'; // 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