Where developers come to connect, share, build and be inspired.

2

Don't trust node-migrator-bot

737 views

From what I've seen, it will render your code useless if you want code to work with both node 0.8 and 0.6. Recommending a blanket change from path.exists to fs.exists is just silly (this also applies to the existsSync function also).

I'd rather see people adopt something like the following:

var fs = require('fs'),
    path = require('path'),
    _exists = fs.exists || path.exists;

And then use the _exists function in your code. You will get compatibility with 0.8 and 0.6 and not get warnings. At a later stage this should probably be removed, but I would think the appropriate time would be once you decide to drop support for 0.6.

To node-migrator-bot - I appreciate the sentiment, but no thanks...

Comments

Add a comment