Closed lichunqiang closed 10 years ago
@cbarrick See official doc http://nodejs.org/api/process.html#process_process_platform
What platform you're running on:
'darwin'
,'freebsd'
,'linux'
,'sunos'
or'win32'
So if windows, process.platform
will always return win32
I recently switched to using lastIndexOf
instead of regexp. Assuming string comparison uses strcmp
and lastIndexOf
uses Boyer-Moore then both should be equal in terms of performance, and lastIndexOf
has the benefit of being slightly more resilient if another Windows platform is ever introduced.
I'm sorry for my careless. :cry: