Node.js for windows and macs forwardslash backslash rectification

Is there a method to rectify the discrepancy in node.js from windows to linux and mac concerning the backslash versus forwardslash? Windows requires backslashes when calling locations in git bash, while mac/linux requires forwardslashes. I'm working on a project with both mac and windows users so I can't change all the fowardslashes to backslashes in the code because when mac users pull, coffee wont be able to properly run for them and vice versa. Is there a solution to this? Thanks

Make sure to use path methods instead of typing out paths. path.normalize() and path.join() are particularly useful when developing cross platform:

On Windows:

$ node
> var p = require('path')
undefined
> p.normalize('/hey/there/you')
'\\hey\\there\\you'
> p.join('/hey', 'there', '/you')
'\\hey\\there\\you'

On Linux:

$ node
> var p = require('path')
undefined
> p.normalize('/hey/there/you')
'/hey/there/you'
> p.join('/hey', 'there', '/you')
'/hey/there/you'

Hope this helps.

In addition to Chad answer, when you are constructing paths you can:

var path = require("path");
"hey" + path.sep + "there" + path.sep + "you"

or

["hey", "there", "you"].join(path.sep);