The goal is to have a module compatible with both 0.6 and 0.8, not one for each version.
-- Diogo Resende On Friday, June 22, 2012 at 2:37 , Dominic Tarr wrote: > you can set what version of node a module is for in the package.json > > "engines": { "node" : "0.6" } > > for example. this does mean you'll have two versions of the code, > feature detection may be easier to maintain. you choice. > > see `npm help json` > > > On Fri, Jun 22, 2012 at 12:14 AM, Roly Fentanes <roly...@gmail.com > (mailto:roly...@gmail.com)> wrote: > > I'm in a similar situation with a module I wrote. And I think I'll just > > write a note in the readme specifying which version should be installed for > > node v0.6.x. > > > > > > On Thursday, June 21, 2012 2:35:15 AM UTC-7, Diogo Resende wrote: > > > > > > Hi, > > > > > > I have a module (node-rack) to abstract the cluster module. It was built > > > for 0.6 and I want to be able to support 0.8 too but not dropping 0.6 > > > support. I noticed for example that `kill()` was renamed to `destroy()`. I > > > think this can be easy to detect but what about events? `death`event was > > > changed to `exit`. > > > > > > Is there a way to know what events an object supports or should I just > > > check the node version (using process.version.node) and do my changes from > > > there? > > > > > > I would prefer the first option as it's similar to feature detection. This > > > way I would just check for available methods and events and use the > > > preferred (and available) ones. > > > > > > -- > > > Diogo Resende > > -- > > Job Board: http://jobs.nodejs.org/ > > Posting guidelines: > > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > > You received this message because you are subscribed to the Google > > Groups "nodejs" group. > > To post to this group, send email to nodejs@googlegroups.com > > (mailto:nodejs@googlegroups.com) > > To unsubscribe from this group, send email to > > nodejs+unsubscr...@googlegroups.com > > (mailto:nodejs+unsubscr...@googlegroups.com) > > For more options, visit this group at > > http://groups.google.com/group/nodejs?hl=en?hl=en > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > (mailto:nodejs@googlegroups.com) > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > (mailto:nodejs+unsubscr...@googlegroups.com) > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en