In the CouchDB Definitive Guide the author says you could use:
// !json templates.edit
// !json blog
// !code vendor/couchapp/path.js
// !code vendor/couchapp/template.js
But why use those macros when you can use require()?
Are there occasions I want to use the macros instead?
Basically this is only of interest when using CouchDB with CouchApp.
It allows for easier separation of the data from the show function.
Normally CouchDB uses the Mozilla’s SpiderMonkey JavaScript Engine to render the views, therefore there is not CommonJS implementation available.
Basically CouchApp allows you to use those JavaScript “show” function (which are stored in the DB) for rendering out HTML.
So in terms of Node.js, no it doesn’t really make sense to use the macros. Also, I quickly looked through the soruce of two of the available CouchDB modules for Node.js, and I couldn’t find any support for the macros, which further indicates that this is some CouchApp specific functionality.