Return 'linux'
on Windows, otherwise return 'win32'
const differentPlatform = require('different-platform');
// on Windows
differentPlatform(); //=> 'linux'
// on a non-Windows OS, for example Linux and macOS
differentPlatform(); //=> 'win32'
Useful for testing the behavior of process.platform
-dependent code on the two platforms in combination with pretend-platform.
npm install different-platform
const differentPlatform = require('different-platform');
Return: string
('linux'
when process.platform
equals to 'win32'
, otherwise 'win32'
)
ISC License © 2018 Shinnosuke Watanabe