int3/jsshaper — comment on commit c18505c090d582671f715621290f2f0d19a65fe2
File:  line 0
By olov:

Thanks! I remember seing the deprecation notice about require.paths but forgot to do something about it.

Older versions of Shaper used relative imports but I changed that because it was cumbersome and for compatibility. The `var Fmt = Fmt || require("fmt.js") || Fmt;` triplet technique is used to support execution via `d8` (v8), `js` (spidermonkey), `node` and browsers. Possibly rhino too. I wrote a short [post](http://blog.lassus.se/2011/04/javascript-modules-in-shells-browsers.html) about that. Does d8/js still function with the relative paths?

An alternative could be to use NODE_PATH. I'm just thinking out loud now. I wouldn't want to force the user to change it before running shaper and I'm not sure whether node reads it once (as it used to do when setting up require.paths) or on every import (so that we could modify it instead of require.paths).

I considered dropping support for everything but node (and browsers) a long time ago and perhaps now is the time. It would open up for standard and simple require's and I suspect that the easier installation (via npm) would make more people try it out. Thoughts?