0.1.1 • Published 7 years ago

ioant-loader v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

npm-package-loader

The loader package is used for loading resources into an IOant node application. Note: Loaders uses promises.

How to use

Loading a configuration json file.

var Loader = require('ioant-loader');
// load(path_to_asset, tag)
Loader.load("./configuration.json", "configuration").then(function(configuration) {
                loaded_configuration = configuration;
                // startApplication(); For example
           }).catch(function(error){
               Logger.log('error', 'Failed to load configuration file');
	       });

Retrieving the preloaded configuration file by its tag.

var Loader = require('ioant-loader');

Loader.getLoadedAsset("configuration").then(function(configuration) {
                loaded_configuration = configuration;
                // startApplication(); For example
           }).catch(function(error){
               Logger.log('error', 'Failed to get loaded configuration file');
	       });