pretend-platform
A Node.js module to pretend the current process is running on a given platform
const pretendPlatform = ; processplatform; //=> 'darwin' ;processplatform; //=> 'win32'
Installation
npm install pretend-platform
API
const pretendPlatform = ;
pretendPlatform(platform)
platform: string
(a platform name to pretend)
Return: string
(the pretended platform name)
It modifies process.platform
into the given value.
pretendPlatform.restore()
Return: String
(pretendPlatform.original
)
It restores process.platform
to the original value.
const pretendPlatform = ; processplatform; //=> 'linux' ;processplatform; //=> 'freebsd' pretendPlatform;processplatform; //=> 'linux'
pretendPlatform.original
Type: string
The read-only property preserving the original process.platform
.
License
ISC License © 2019 Shinnosuke Watanabe