{"id":18657782,"url":"https://github.com/lightsofapollo/step-object","last_synced_at":"2025-11-05T22:30:21.387Z","repository":{"id":2104701,"uuid":"3046095","full_name":"lightsofapollo/step-object","owner":"lightsofapollo","description":"Extension for Step completely experimental","archived":false,"fork":false,"pushed_at":"2012-02-27T21:57:21.000Z","size":108,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-10T07:14:50.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/lightsofapollo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2011-12-24T21:15:07.000Z","updated_at":"2014-01-01T04:01:49.000Z","dependencies_parsed_at":"2022-09-26T16:22:20.200Z","dependency_job_id":null,"html_url":"https://github.com/lightsofapollo/step-object","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Fstep-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Fstep-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Fstep-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Fstep-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightsofapollo","download_url":"https://codeload.github.com/lightsofapollo/step-object/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239217107,"owners_count":19601594,"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-07T07:29:51.912Z","updated_at":"2025-11-05T22:30:21.332Z","avatar_url":"https://github.com/lightsofapollo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Object based creation of step functions.\n\nStill an experiment at this stage.\n\n## Step Creation\n\n    var StepObject = require('step-object'),\n        fs = require('fs');\n\n    var ReadDir = StepObject({\n\n      _filter: function(files){\n        var filteredFiles;\n\n        //some filter logic\n        return filteredFiles;\n      },\n\n      queue: function(path){\n        fs.readdir(path, this);\n      },\n\n      read: function(err, files){\n        if(err){\n          throw err;\n        }\n\n        return this._filter(files);\n      },\n\n    }, ['queue', 'read']);\n\n    ReadDir(function(err, files){\n      //files is the result of read\n    });\n    \n    \n    \n\n## Testing\n\nOne problem I ran into using step initially was gaining access to the\nscope in which the steps actually execute in.\n\nI still perfer to specify the behaviour of each function which becomes\nvery difficult if these functions utlize the shared contex to store\ninformation.\n\nThe below will give you a reference to the the context the step\nexecution. This is the same object you refer to when using 'this' inside\nof your step methods.\n\n\n    //Note that this will not call queue from the above example\n    var subject = require('step-object/lib/mock-step-object')(ReadDir);\n\n    subject.queue //\n\n\nIts important for me to note that this works via a simple hack\nwhere by not returning anything in a function the step execution\nhalts because its effectivly waiting for a callback to execute.\n\nSo if you did the following:\n\n    subject(); \n    //(which is the same as `this()` or next inside of step scope)\n\n\nIt will cause werid things to happen such as two steps\nexecuting without waiting for the other to finish.\n\n\n### Group / Parallel\n\nThe `.group` and `.parallel` functions are overriden to return\nthemselves. This is so you can spy for them inside of your tests.\n\n## Methods / Order\n\nYou can also gain access to methods and order of the StepObject at\nanytime with:\n\n    ReadDir.methods //{queue: ....}\n    ReadDir.order //['queueRead', 'fsReadDir']\n\n\n\n## License\n\nSee LICENSE (MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightsofapollo%2Fstep-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightsofapollo%2Fstep-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightsofapollo%2Fstep-object/lists"}