{"id":17946990,"url":"https://github.com/defstream/work.flow","last_synced_at":"2025-03-24T20:32:53.917Z","repository":{"id":54808299,"uuid":"48517231","full_name":"defstream/work.flow","owner":"defstream","description":"The asynchronous workflow library for Node","archived":false,"fork":false,"pushed_at":"2023-03-22T00:45:30.000Z","size":204,"stargazers_count":5,"open_issues_count":28,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T01:52:11.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://defstream.github.io/work.flow","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/defstream.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":"2015-12-24T00:43:13.000Z","updated_at":"2023-03-05T02:01:16.000Z","dependencies_parsed_at":"2022-08-14T03:30:54.621Z","dependency_job_id":null,"html_url":"https://github.com/defstream/work.flow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstream%2Fwork.flow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstream%2Fwork.flow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstream%2Fwork.flow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstream%2Fwork.flow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defstream","download_url":"https://codeload.github.com/defstream/work.flow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245348363,"owners_count":20600631,"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-10-29T07:08:17.133Z","updated_at":"2025-03-24T20:32:53.497Z","avatar_url":"https://github.com/defstream.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## work.flow - The asynchronous workflow library for Node\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"http://npmjs.com/package/work.flow\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/work.flow.svg\"\n        alt=\"npm version\"\u003e\u003c/a\u003e\n\n  \u003ca href=\"https://gemnasium.com/defstream/work.flow\"\u003e\u003cimg src=\"https://img.shields.io/gemnasium/defstream/work.flow.svg\"\n       alt=\"Gemnasium\"\u003e\u003c/a\u003e\n\n  \u003ca href=\"https://travis-ci.org/defstream/work.flow\"\u003e\u003cimg src=\"https://img.shields.io/travis/defstream/work.flow.svg\"\n       alt=\"build status\"\u003e\u003c/a\u003e\n\n  \u003ca href=\"https://codecov.io/github/defstream/work.flow\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/github/defstream/work.flow.svg\"\n        alt=\"coverage\"\u003e\u003c/a\u003e\n\n  \u003ca href=\"https://circleci.com/gh/defstream/work.flow\"\u003e\u003cimg src=\"https://img.shields.io/circleci/project/defstream/work.flow.svg\"\n       alt=\"coverage\"\u003e\u003c/a\u003e\n\n  \u003ca href=\"https://snyk.io/test/npm/work.flow\"\u003e\u003cimg src=\"https://snyk.io/test/npm/work.flow/badge.svg\" alt=\"Known Vulnerabilities\"\u003e\u003c/a\u003e\n\n  \u003ca href=\"http://npm-stat.com/charts.html?package=work.flow\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/work.flow.svg\" alt=\"downloads\"\u003e\u003c/a\u003e\n\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://gitter.im/defstream/work.flow\"\u003e\u003cimg src=\"https://img.shields.io/gitter/room/defstream/work.flow.svg\"\n     alt=\"Chat\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.github.com/defstream/work.flow/master/logo.png\"\u003e\n\u003c/p\u003e\n\n**work.flow** is an asynchronous workflow library for Node.\n\nThe current version is 0.0.0 and is still going through documentation and testing before development starts, **Unless you are contributing, you should probably not be using this.**\n\nThe purpose of work.flow is to provide a means of creating individual pieces of code that can be used to quickly create applications or data processing pipelines.\n\n**More Information**\n- Flow-based Programming http://www.jpaulmorrison.com/fbp/\n- Flow-based programming https://en.wikipedia.org/wiki/Flow-based_programming\n\n\n### TLDR;\n\n**print-line.js**\n\n```javascript\nvar work = require('work.flow');\n\nmodule.exports = work.flow.task.definition({\n\turi: 'incredi.co/games/worlds-fastest-game/print-line',\n\tproperties: {\n\t\tmessage: {\n\t\t\ttype: String,\n\t\t\tvalue: ''\n\t\t}\n\t},\n\ttask: function(options, complete) {\n\t\tvar message = options.properties.message;\n\t\tconsole.log(message);\n\t\treturn complete(null, message);\n\t}\n});\n\n```\n\n**ask-name.js**\n\n```javascript\n\nvar util = require('util');\nvar work = require('work.flow');\nvar readline = require('readline');\n\nvar io = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout\n});\n\nmodule.exports = work.flow.task.definition({\n\turi: 'incredi.co/games/worlds-fastest-game/ask-name',\n\tproperties: {\n\t\tfor: {\n\t\t\ttype: String,\n\t\t\tvalue: 'Buddy'\n\t\t},\n\t\tprompt: {\n\t\t\ttype: String,\n\t\t\tvalue: 'Hey %s, What is your name?',\n\t\t\treadOnly: true\n\t\t}\n\t},\n\ttask: function(options, complete) {\n\t\tvar prompt = util.format(options.properties.prompt, options.properties.for);\n\t\treturn io.question(prompt, function(name) {\n\t\t\treturn complete(null, name);\n\t\t});\n\t}\n});\n\n```\n\n**ask-for-player-names.js**\n\n```javascript\nvar work = require('work.flow');\n\nrequire('./ask-name');\n\nmodule.exports = work.flow.path.definition({\n\turi: 'incredi.co/games/worlds-fastest-game/paths/ask-for-player-names',\n\tstart: [{\n\t\tname: 'player-one',\n\t\turi: 'incredi.co/games/worlds-fastest-game/ask-name',\n\t\tproperties: {\n\t\t\tfor: 'Player 1'\n\t\t}\n\t}, {\n\t\tname: 'player-two',\n\t\turi: 'incredi.co/games/worlds-fastest-game/ask-name',\n\t\tproperties: {\n\t\t\tfor: 'Player 2'\n\t\t}\n\t}],\n\ttimeout: 6000,\n\terror: [{\n\t\turi: 'work.flow/task/restart'\n\t}]\n});\n\n```\n\n**workflow.js**\n\n```javascript\nvar work = require('work.flow');\n\nrequire('./print-line');\nrequire('./ask-for-player-names');\n\nmodule.exports = work.flow.definition({\n\tname: 'worlds-fastest-game',\n\turi: 'incredi.co/games/worlds-fastest-game',\n\tstart: [{\n\t\tname: 'ask-names',\n\t\turi: 'incredi.co/games/worlds-fastest-game/paths/ask-for-player-names'\n\t}, {\n\t\tname: 'determine-winner',\n\t\turi: 'work.flow/task/if-then-else',\n\t\tproperties: {\n\t\t\tif: {\n\t\t\t\tvalue: function(options, callback) {\n          //@info return a random number between 1 \u0026 2.\n\t\t\t\t\treturn callback(null, Math.round(Math.random() * (2 - 1) + 1));\n\t\t\t\t},\n\t\t\t\tequals: 1,\n\t\t\t\tthen: [{\n\t\t\t\t\tname: 'player-one-wins',\n\t\t\t\t\turi: 'incredi.co/games/worlds-fastest-game/print-line',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tmessage: '{ask-names.player-one} WINS!!!!'\n\t\t\t\t\t}\n\t\t\t\t}],\n\t\t\t\telse: [{\n\t\t\t\t\tname: 'player-two-wins',\n\t\t\t\t\turi: 'incredi.co/games/worlds-fastest-game/print-line',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tmessage: '{ask-names.player-two} WINS!!!!'\n\t\t\t\t\t}\n\t\t\t\t}]\n\t\t\t}\n\t\t}\n\t}, {\n\t\turi: 'work.flow/workflow/restart'\n\t}],\n\ttimeout: 6000,\n\terror: [{\n\t\turi: 'work.flow/workflow/restart'\n\t}]\n});\n\n```\n\n**index.js**\n\n```javascript\nvar workflow = require('./workflow');\n\n//@info lets run the worlds fastest game\nworkflow.run(function(err, context){\n  //@info The worlds fastest game is also the longest\n  //      If you take a close look at the work flow\n  //      It will never actually end...\n  console.log('MUAHAHAHAHAHAHAHAH');\n});\n\n\n```\n\n# Installation\n\n```shell\n$ npm install work.flow --save\n```\n\n# Development Scripts\nBefore running any development scripts, be sure to first install the dev modules.\n\n```shell\n$ npm install work.flow --save --dev\n```\n\n#### Build Documentation\nOutputs code documentation files to the `./doc/api` folder.\n\n```shell\n$ npm run doc\n```\n\n#### Static Analysis\nOutputs static analysis files to the `./doc/analysis` folder.\n\n```shell\n$ npm run analyze\n```\n\n#### Test + Coverage\nOutputs code coverage files to the `./doc/coverage` folder.\n\n```shell\n$ npm run test\n```\n\n**CURRENT COVERAGE REPORT**\n\n![codecov.io](https://codecov.io/github/defstream/work.flow/branch.svg?branch=master)\n\n### Discuss\nChat channel:    \u003ca href=\"https://gitter.im/defstream/work.flow\"\u003e\u003cimg src=\"https://img.shields.io/gitter/room/defstream/work.flow.svg\" alt=\"Chat\"\u003e\u003c/a\u003e\n\nQuestions or comments can also be posted on the work.flow Github issues page.\n\n### Maintainers\nHector Gray (Twitter: \u003ca href=\"https://twitter.com/defstream\"\u003e@defstream\u003c/a\u003e)\n\n### Contribute\nPull Requests welcome. Please make sure all tests pass:\n\n```shell\n$ npm test\n```\n\nPlease submit \u003ca href=\"https://github.com/defstream/work.flow/issues\"\u003eGithub issues\u003c/a\u003e for any feature enhancements, bugs or documentation problems.\n\n### License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefstream%2Fwork.flow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefstream%2Fwork.flow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefstream%2Fwork.flow/lists"}