danielgtaylor/nesh — pull request #16 by ccheever (2014-03-26 08:31:55+00:00)
Title: Add nesh-fibrous plugin as a default plugin

This plugin adds lets you use Fibrous from the REPL in nesh if you start it with the `-f` or `--fibrous` option.

Fibrous is really useful in an interactive context because it allows you to capture the "return values" that are passed to callbacks in a very convenient way. Even if you don't use Fibers in your Node programs, its quite useful when want to interact with the software through the shell.

This implementation is pretty lightweight since it doesn't mean that nesh will pull in fibrous; it uses https://github.com/ccheever/use-global-fibrous which will only use a globally installed copy of fibrous, and it doesn't change the basic behavior of nesh. You only get the fibrous functionality if you use the command line flag.

I think its less obvious that this patch merits inclusion by default in nesh but I think its actually the single most useful addition to the shell that I've made (if I could only have one, I would take this over nesh-require and nesh-doc). Wanting to capture and then inspect and manipulate values that are the result of callback-driven async calls is invaluable whenever you want to test code you've written in that style.

Oftentimes, people don't even realize that this is possible or what they want, and so there's some value in including it in the default distribution of nesh for that reason. Here's a recent example of where its helpful:
https://github.com/danielgtaylor/nesh/issues/10