Task templates
FilesWorkflow provides ready-to-use task templates to help you get started quickly. These templates are available on GitHub for both JavaScript and TypeScript, covering browser-tasks and server-tasks.
Template Repositories:
Browser-Task (JavaScript): https://github.com/FilesWorkflow/browser-task-js-template
Browser-Task (TypeScript): https://github.com/FilesWorkflow/browser-task-ts-template
Server-Task (JavaScript): https://github.com/FilesWorkflow/server-task-js-template
Server-Task (TypeScript): https://github.com/FilesWorkflow/server-task-ts-template
How to Use:
Clone the desired template repository:
git clone [repository-url]
Navigate to the cloned directory and install dependencies:
cd [template-directory] npm install
Configure your task by editing the
taskConfig
inpackage.json
:{ "taskConfig": { "name": "My Custom Task", "description": "A brief description of what this task does", "inputType": 0, "supportedFileTypes": ["png", "jpg"], "params": [ { "id": "quality", "key": "quality", "defaultValue": 0.8 } ] } }
inputType: 0 (single file), 1 (multiple files)
Develop and test your task using the provided development environment.
npm run dev
Build your task:
npm run build
Import your task:
Go to the task editing page in FilesWorkflow.
Click on "Import".
Select the root directory of the project.
FilesWorkflow will automatically populate the task settings based on your
taskConfig
.
These templates provide a solid foundation for creating custom tasks in FilesWorkflow, allowing you to focus on implementing your specific functionality.
Last updated