0.0.4 • Published 5 years ago

aeson v0.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Aeson (father of Jason)

Build Status Coverage Status

A simple javascript library to dynamically load json properties files

Usage examples

let jsons = new aeson(fetch);

// loading with only path
jsons.loadJsons('/test/resources/json/lang.json',
()=>{
    console.log(jsons.getProperty('lang', 'i18n_apex','blabla'));
});

// loading with array of paths
jsons.loadJsons(['/test/resources/json/lang2.json','/test/resources/json/theme.json'],
()=>{
    console.log(jsons.getProperty('lang2', 'i18n_apex','blabla'));
    console.log(jsons.getProperty('theme', 'GridHoverColor','red'));
});

// loading with object
jsons.loadJsons(
    {path : '/test/resources/json/lang.json', id : 'i18n'}
,
()=>{
    console.log(jsons.getProperty('i18n', 'i18n_apex','blabla'));
});

// loading with array of objects
let jsons = new aeson(fetch);
jsons.loadJsons([
    {path : '/test/resources/json/theme.json', id : 'id1'},
    {path : '/test/resources/json/lang.json', id : 'id2'}
],
()=>{
    console.log(jsons.getProperty('id1', 'GridHoverColor','red'));
    console.log(jsons.getProperty('id2', 'i18n_apex','blabla'));
});
0.0.4

5 years ago

0.0.3

6 years ago

0.0.2

7 years ago

0.0.1

7 years ago