path-browserify icon indicating copy to clipboard operation
path-browserify copied to clipboard

Windows support

Open cjblomqvist opened this issue 10 years ago • 5 comments

The separator is hard-coded as '/' but in reality, node also supports windows which has '' as default separator (see http://nodejs.org/api/path.html#path_path_sep ). This should be automatically detected and all fns that split things up depending upon the separator should should the os-proper separator.

cjblomqvist avatar Dec 12 '14 14:12 cjblomqvist

I've been digging some more into this and come to the following conclusion:

  • It's easy to add windows support. It's just a matter of getting the full path.js from the joyent/node -repo (dunno if it works in all browsers then but it seemed to work for me anyway)
  • However, browserify's process dependency does not include the process.platform var, because it's just a plain js-file not processed.
  • Thus, it doesn't work anyway because path.js wouldn't recognize the platform

Is it possible to get the process.platform to get set using some kind of preprocessing on the process lib used? Any help is greatly appreciated! If I get a few pointers I'll happily make PRs where appropriate to make everything work for both platforms (nix/windows).

cjblomqvist avatar Dec 12 '14 15:12 cjblomqvist

See the reference for a workaround.

cjblomqvist avatar Dec 12 '14 16:12 cjblomqvist

Windows support would be an enormous help for users trying to maintain cross-platform code. This is literally issue #1 - it would be so good to see support for this.

Nantris avatar Jan 15 '22 21:01 Nantris

Oh whoops, just posted this: https://github.com/browserify/path-browserify/issues/31

The module is unusable for Windows users until this is resolved.

chopin2256 avatar Jun 29 '23 20:06 chopin2256