added requireReload function
This commit is contained in:
@ -2,12 +2,14 @@
|
||||
/// <reference path="./smartfile.plugins.ts" />
|
||||
/// <reference path="./smartfile.simple.ts" />
|
||||
/// <reference path="./smartfile.vinyl.ts" />
|
||||
/// <reference path="./smartfile.require.ts" />
|
||||
var plugins = SmartfilePlugins.init();
|
||||
|
||||
|
||||
var smartfile:any = {};
|
||||
SmartfileSimple.init(smartfile);
|
||||
SmartfileVinyl.init(smartfile);
|
||||
SmartfileRequire.init(smartfile);
|
||||
|
||||
|
||||
|
||||
|
@ -7,7 +7,8 @@ module SmartfilePlugins {
|
||||
path: require("path"),
|
||||
vinyl: require("vinyl"),
|
||||
vinylFile: require("vinyl-file"),
|
||||
yaml: require("js-yaml")
|
||||
yaml: require("js-yaml"),
|
||||
requireReload: require("require-reload")
|
||||
};
|
||||
return plugins;
|
||||
}
|
||||
|
10
ts/smartfile.require.ts
Normal file
10
ts/smartfile.require.ts
Normal file
@ -0,0 +1,10 @@
|
||||
/// <reference path="./index.ts" />
|
||||
module SmartfileRequire {
|
||||
var requireReload = function(path:string){
|
||||
return plugins.requireReload(path);
|
||||
};
|
||||
|
||||
export var init = function(objectArg){
|
||||
objectArg.requireReload = requireReload;
|
||||
}
|
||||
}
|
@ -5,4 +5,5 @@ beautylog.info(smartfile.readFileToString("./test/mytest.txt"));
|
||||
console.log(smartfile.readFileToObject("./test/mytest.yaml"));
|
||||
console.log(smartfile.readFileToObject("./test/mytest.json"));
|
||||
console.log(smartfile.readFileToVinyl("./test/mytest.json"));
|
||||
//var thisIsAnError = smartfile.readFileToObject("./test/mytestDoesNotExist.json");
|
||||
//var thisIsAnError = smartfile.readFileToObject("./test/mytestDoesNotExist.json");
|
||||
beautylog.success("Test passed!");
|
||||
|
Reference in New Issue
Block a user