senchalabs/connect — pull request #692 by langpavel (2012-11-13 16:39:31+00:00)
Title: directory middleware: Add optional sorting strategy

This add `sort` option to `directory` middleware.

sort can be string or custom function. If custom function has `needStat` property set, `stat` of files are provided with `name` property added to this custom compare function.

Usage
---------
```js
app.use(connect.directory(SERVER_ROOT, {
icons: true,
sort: 'alphaDirFirst',
}));
```