{"id":20669300,"url":"https://github.com/ivanparvaresh/ftaskrunner","last_synced_at":"2026-04-17T14:32:16.454Z","repository":{"id":57242553,"uuid":"56452719","full_name":"ivanparvaresh/FTaskRunner","owner":"ivanparvaresh","description":"Create and run synced tasks in fluent way","archived":false,"fork":false,"pushed_at":"2016-07-12T20:29:51.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T10:26:45.051Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivanparvaresh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-17T18:50:55.000Z","updated_at":"2016-04-17T18:54:36.000Z","dependencies_parsed_at":"2022-09-04T12:51:08.043Z","dependency_job_id":null,"html_url":"https://github.com/ivanparvaresh/FTaskRunner","commit_stats":null,"previous_names":["javadparvaresh/ftaskrunner"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanparvaresh%2FFTaskRunner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanparvaresh%2FFTaskRunner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanparvaresh%2FFTaskRunner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanparvaresh%2FFTaskRunner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivanparvaresh","download_url":"https://codeload.github.com/ivanparvaresh/FTaskRunner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242883700,"owners_count":20200979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T20:13:44.367Z","updated_at":"2026-04-17T14:32:16.389Z","avatar_url":"https://github.com/ivanparvaresh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"FTaskRunner\n=========== \n\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://github.com/javadparvaresh/FTaskRunner/blob/master/LICENSE)\n[![Latest Stable Version](http://img.shields.io/github/release/javadparvaresh/FTaskRunner.svg)](https://github.com/javadparvaresh/FTaskRunner)\n[![Total Downloads](https://img.shields.io/github/downloads/javadparvaresh/FtaskRunner/total.svg)](https://github.com/javadparvaresh/FTaskRunner)\n\n\nFTaskRunner is a Node-JS library that lets you to create a flunet way tasks and \nexecute them asynchronous. this library is and will stay open soruce.\n\n\u003e its not for long running process\n\n\n## Installation\n```shell\n    npm install FtaskRunner\n```\n\n## Usage\n\n###1. Simple\n  \n```javascript\nvar ftask=require(\"ftaskrunner\");\nftask.build(\"helloWorld\"function(root){\n    \n    root.for(1,5).print();\n    \n}).run(function(result){\n    \n    console.log(\"process completed\");\n    console.log(\"\\t result:\" + result.helloWorld.result[0]);\n    \n})\n```\n\u003e Result :\n```shell\n1\n2\n3\n4\n5\nprocess completed\nresult: [1,2,3,4,5]\n```\n\n### 2.Advance\n\n```javascript\nvar ftask=require(\"FTaskRunner\");\nvar ftaskMysql=require(\"FTaskRunner-Mysql\");\n\nftask.load(ftaskMysql).build(\"helloWorld\"function(root){\n    \n    root\n        .for(1,5)  // load a loop from 1 to 5 \n        .custom(function(scope,next){ // create query based on loop\n            next(\"SELECT * FROM TABLE where i\u003e\" + scope.$$input);\n        })\n        .mysqlQuery({ host:127.0.0.1,user:'sa',pass:'sa' }) // executes the query\n        .foreach() // loop on every record\n        .print(); // print record data into console\n    \n}).run(function(result){\n    \n    console.log(\"process completed\");\n    console.log(\"\\t result:\" + result.helloWorld.result[0]);\n    \n})\n```\n\n# Documents\n\n## Overview\n\nFtask have 2sides, one building a process and another running the process.\nat first you need to build your process by piping block to gather\nnext you need to run the branches and at the end you can have the result.  \n\n## Building process\n\nTo create process you need to have a name and execution plan. ftask has a \"build\" method which accepts name and builderFunction.\n* name : all process results returns by this name\n* bulderFunction : a function which let you create your execution plan.\n* block : every process created by piping blocks to gather. a block is a container of task and context of state.\n\n\u003e ftask allow you to create more than one execution plan, just by calling build method you can create more process.\n\n\u003e every process has a root block. root block is fluentable and all loaded task will load into block. \n\nin following example you can see we have used \"for\",\"string\" and \"print\" task to create process.\n\n```javascript\n\nvar ftask=require(\"FTaskRunner\");\nftask.build(\"test\",function(root){\n    \n    root\n        .for(1,2)\n        .string(\"hello\").print();\n    \n});\n\n``` \n\n## Load a tasks\n\nFtask cames with a simple required core tasks. but you can develope your own tasks or use npm or any other tools to load other tasks libraries.\nby calling load method you can load other tasks into your project and then use them in fluent way.\n\n\nin following example you can see we have loaded mysql tasks library and used those task to create a process.\n\n``` javascript\nvar ftask=require(\"FTaskRunner\");\nvar ftaskMySql=require(\"FTaskRunner-MySql\");\nftask.load(ftaskMySql).build(\"test\",function(root){\n    \n    // this sample execute a query twice and print the result in output\n    \n    root\n        .for(1,2)\n        .string(\"select 1 as id\")\n        .mysqlQuery({host:'',port:'',...})\n        .print();\n     \n});\n```\n\nin this sample we have loaded MySql Tasks into build process and use them to build a process.\n\n## Run a process\n\nAfter you have created your process, its time to run it. for running a process you just \nneed to call \"run\" method of ftask. ftask will handle the rest. the result will returns as a callback function.\nftask will rise callback function by passing err,result arguments. if process executed with error, the err argument will contains error detail otherwise results will contains all branchs of ftask result. \n\n```javascritp\n\n\n```\n\n\n##Github\nReleases of FTaskRunner are available on [Github](https://github.com/javadparvaresh/FTaskRunner/releases).\n\n##License\nFTaskRunner is licensed under the MIT License. See the LICENSE file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanparvaresh%2Fftaskrunner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanparvaresh%2Fftaskrunner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanparvaresh%2Fftaskrunner/lists"}