UNPKG

easy-api.ts

Version:

A powerful library to create your own API with ease.

1 lines 812 B
Object.defineProperty(exports,"__esModule",{value:!0});let tslib_1=require("tslib"),APIFunction_1=require("../../classes/structures/APIFunction"),Error_1=require("../../classes/structures/Error"),fs_1=tslib_1.__importDefault(require("fs"));class CreateFolder extends APIFunction_1.APIFunction{name="$createFolder";description="Creates a folder in the provided path.";parameters=[{name:"Path",description:"The path of the file to append content to.",type:APIFunction_1.ParamType.String,required:!0,rest:!1,defaultValue:null}];usage="$createFolder[path]";returns=APIFunction_1.ParamType.Unknown;compile=!0;aliases=[];async run(e,[r]){try{fs_1.default.mkdirSync(r)}catch(r){throw new Error_1.EATS_Error(["Unable to create the folder: "+e.function?.name,"with reason: "+r].join("\n"))}}}exports.default=CreateFolder;