It depends on what you mean by "inside." Projects like
browserify.org make (some) npm modules usable in the browser, so you
could use them in front-end development. NPM modules also work well
during development--minification, etc.
CouchDB does support CommonJS requires, and many/most CommonJS
compatible libraries do work in CouchDB:
http://wiki.apache.org/couchdb/CommonJS_Modules
Moment.js (for one) works just fine. Here's some example code:
https://github.com/cloudant-labs/Spellbook/tree/master/date-arrays
However, CouchDB uses SpiderMonkey (currently) under the hood, so
there's no V8 nor node.js "lower level" stuff available. It also
doesn't provide the DOM API, XHR, or other "heavier" APIs. Many of
the NPM modules are focused on building servers, and those would be
far outside of the scope of what the JavaScript that runs *inside*
CouchDB is intended to do.
There is an experimental node.js-based view server available out
there, but I've no idea what/if any additional functionality that
will bring to the table--or if it's just going to swap out
SpiderMonkey for V8. If you find out, I'd love to know! :)
Hope something in there was helpful. :)
Later,
Benjamin