Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mheiber/run.js
Control flow experiment for Node
https://github.com/mheiber/run.js
Last synced: 21 days ago
JSON representation
Control flow experiment for Node
- Host: GitHub
- URL: https://github.com/mheiber/run.js
- Owner: mheiber
- Created: 2014-09-13T20:42:28.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-19T23:40:33.000Z (almost 10 years ago)
- Last Synced: 2024-10-16T01:44:13.855Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 152 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# run.js
Control flow experiment for NodeI used [Async.js](https://github.com/caolan/async) for control flow and really liked the `auto` method for specifying the depenencies of a function. However, the syntax is cumbersome and the need for an extra argument can lead to errors or difficult workarounds.
I thought it would be nice to have a function `run` that let's you do: `run(func, arguments)` that runs when the arguments to the function are "ready."
and ended up reinventing a more crummy version of promises. So I refactored the code to use promises, played around with it, and switched to the [Q promise library](https://github.com/kriskowal/q).
Still, it was fun to write the tests and play with `run`. The Mocha tests in the `test` directory show how to use it.