easy-api.ts
Version:
A powerful library to create your own API with ease.
1 lines • 956 B
JavaScript
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 AppendContent extends APIFunction_1.APIFunction{name="$appendContent";description="Appends content to the end of the provided file.";parameters=[{name:"Path",description:"The path of the file to append content to.",type:APIFunction_1.ParamType.String,required:!0,rest:!1,defaultValue:null},{name:"Content",description:"The content to append to the file.",type:APIFunction_1.ParamType.String,required:!0,rest:!1,defaultValue:null}];usage="$appendContent[path;content]";returns=APIFunction_1.ParamType.Unknown;compile=!0;aliases=[];async run(e,[t,n]){try{fs_1.default.appendFileSync(t,n)}catch(e){throw new Error_1.EATS_Error("Cannot append content to the file with reason:\n"+e)}}}exports.default=AppendContent;