Skip to content
🔀 Solutions and non-solutions to JavaScript's async problem
JavaScript Shell Makefile
Branch: master
Clone or download
davidchambers Merge pull request #34 from laduke/master
Add node streams example.
Latest commit d53c39d Sep 4, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
common Revenge of the callbacks! Jul 15, 2018
input initial solutions Jul 8, 2015
.gitignore spring clean Jun 21, 2017
Makefile spring clean Jun 21, 2017
README.md Add node streams example. Sep 4, 2018
async.js spring clean Jun 21, 2017
await.js spring clean Jun 21, 2017
bluebird-promisell.js spring clean Jun 21, 2017
callbacks-revenge.js
callbacks.js spring clean Jun 21, 2017
coroutines-bluebird.js spring clean Jun 21, 2017
coroutines-co.js
futures.js spring clean Jun 21, 2017
most.js spring clean Jun 21, 2017
node-streams.js
package.json Add node streams example. Sep 4, 2018
promises-pipe.js spring clean Jun 21, 2017
promises-ramda.js spring clean Jun 21, 2017
promises.js spring clean Jun 21, 2017
righto.js
synchronous.js spring clean Jun 21, 2017
tasks.js spring clean Jun 21, 2017
test Add node streams example. Sep 4, 2018

README.md

JavaScript has a problem

We like to say that JavaScript has a callback problem. This project considers various approaches to the following problem:

Given a path to a directory containing an index file, index.txt, and zero or more other files, read the index file (which contains one filename per line), then read each of the files listed in the index concurrently, concat the resulting strings (in the order specified by the index), and write the result to stdout.

The program's exit code should be 0 if the entire operation is successful; 1 otherwise.

All side effects must be isolated to the main function. Impure functions may be defined at the top level but may only be invoked in main.

The solutions are best read in the following order:

The above ordering is suggested reading order only – not grade. Solutions are graded on the following criteria:

  • the size of main (smaller is better); and
  • the degree to which the approach facilitates breaking the problem into manageable subproblems.

† Perhaps in five years we'll be saying that JavaScript has a promise problem.

You can’t perform that action at this time.