hns/stick — Issue #27: Make Stick work with Common Node
Author: olegp
Created: 2012-01-30 18:48:19+00:00
State: open

My [fork of Stick](https://github.com/olegp/stick) works with [Common Node](http://github.com/olegp/common-node/) for the most part (while still working with Ringo) but it's rough around the edges. It would be good to come to some agreement on how to address these rough edges, clean up my fork and merge it back in. I'll list the changes I made below:

* there's no destructuring assignment in V8, so I've changed the require lines accordingly
* module.resolve doesn't exist in Node (there is require.resolve, but it doesn't work on directories), so I've [refactored](https://github.com/olegp/stick/issues/2) it out into a global resolve function - perhaps there's a neater cross platform solution here?
* there are a number of pure JS utility modules that are part of Ringo but aren't part of any CommonJS spec (yet?) so I've split them out into a generic utility modules package called [common-utils](http://github.com/olegp/common-utils/) as well as HTTP specific ones in [stick/lib/utils](https://github.com/olegp/stick/tree/master/lib/utils)
* the profiler and continuation middleware depend on Rhino, so I've commented them out, same with zip middleware
* Stick relies on ServletRequest in a few places, so I've [created dummy objects for that](https://github.com/olegp/stick/commit/1bc5abc9cbf5c2b56b9e672cbc6f9d00d4a4ede9)
* according to the CommonJS IO spec, Binary isn't an array, so I [pre-convert to an array](https://github.com/olegp/stick/commit/88925d9c5ae67806319bb3122f901730d778d5ff)
* I've added getResource to common-node even though it's not part of any CommonJS spec, but [instanceof org.ringojs...Resource doesn't work](https://github.com/olegp/stick/commit/9d81aab88e2093f5e8d987f9f6d2eebd371a6e16)

There's also a few other [open issues](https://github.com/olegp/stick/issues?sort=created&direction=desc&state=open&page=1) that I haven't addressed yet.

Any comments or suggestions would be greatly appreciated.