Skip to content

Commit

Permalink
Merge branch 'md' of github.com:rvagg/learnyounode
Browse files Browse the repository at this point in the history
Conflicts:
	problems/make_it_modular/problem.md
	problems/my_first_io/problem.md
	problems/time_server/problem.md
  • Loading branch information
rvagg committed Jan 10, 2014
2 parents d05bcb7 + 3957a83 commit a84e859
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion problems/make_it_modular/problem.md
Expand Up @@ -4,7 +4,7 @@ Create a program that prints a list of files in a given directory, filtered by t

You must write a *module* file to do most of the work. The module must *export* a single function that takes **three** arguments: the directory name, the filename extension string and a callback function. The filename extension argument must be the same as was passed to your program. i.e. don't turn it in to a RegExp or prefix with "." or do anything else but pass it to your module where you can do what you need to make your filter work.

The callback function must be called using the idomatic node(err, data) convention. This convention stipulates that unless there's an error, the first argument passed to the callback will be null, and the second will be your data. In this case the data will be your filtered list of files, as an Array. If you receive an error, e.g. from your call to `fs.readdir()`, the callback must be called with the error, and only the error, as the first argument.
The callback function must be called using the idiomatic node(err, data) convention. This convention stipulates that unless there's an error, the first argument passed to the callback will be null, and the second will be your data. In this case the data will be your filtered list of files, as an Array. If you receive an error, e.g. from your call to `fs.readdir()`, the callback must be called with the error, and only the error, as the first argument.

You **must** not print directly to the console from your module file, only from your original program.

Expand Down

0 comments on commit a84e859

Please sign in to comment.