https://github.com/shinnn/different-platform
Return 'linux' on Windows, otherwise return 'win32'
https://github.com/shinnn/different-platform
cross-platform-development javascript nodejs platform
Last synced: 2 months ago
JSON representation
Return 'linux' on Windows, otherwise return 'win32'
- Host: GitHub
- URL: https://github.com/shinnn/different-platform
- Owner: shinnn
- License: isc
- Created: 2017-07-20T10:53:59.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-02-25T11:58:45.000Z (over 7 years ago)
- Last Synced: 2024-12-07T09:22:03.135Z (over 1 year ago)
- Topics: cross-platform-development, javascript, nodejs, platform
- Language: JavaScript
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# different-platform
[](https://www.npmjs.com/package/different-platform)
[](https://travis-ci.com/shinnn/different-platform)
[](https://coveralls.io/github/shinnn/different-platform?branch=master)
Return `'linux'` on Windows, otherwise return `'win32'`
```javascript
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`](https://nodejs.org/api/process.html#process_process_platform)-dependent code on the two platforms in combination with [pretend-platform](https://github.com/shinnn/pretend-platform).
## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install different-platform
```
## API
```javascript
const differentPlatform = require('different-platform');
```
### differentPlatform()
Return: `string` (`'linux'` when `process.platform` equals to `'win32'`, otherwise `'win32'`)
## License
[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe