0.1.2 • Published 7 years ago

languagenpm v0.1.2

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

languagenpm

======

node js language util module

#1 load libs

const langPackage = require('languagenpm');

const langPacks = {};

#2 init language

langPacks.vi = new langPackage();

langPacks.en = new langPackage();

langPacks.vi.importJSON('path to json file');

#3 use

const key = 'HELLO';

const objReplace = {username: 'Andrew', lastLogin: '03/21/2017'};

const result = langPacks.vi.get(key, objReplace);

#4 json language sample

{ "HELLO":"Hello {username}. Your last login on: {lastLogin}" }

0.1.2

7 years ago

0.1.0

7 years ago