to-executable-name
v2.0.0
Published
Append .exe to a given string if the program is running on a Windows environment
Downloads
151
Maintainers
Readme
to-executable-name
Append .exe
to a given string if the program is running on a Windows environment
const toExecutableName = require('to-executable-name');
// On Windows
toExecutableName('node'); //=> 'node.exe'
// Otherwise
toExecutableName('node'); //=> 'node'
Installation
npm install to-executable-name
API
const toExecutableName = require('to-executable-name');
toExecutableName(binName [, option])
binName: string
option: Object
Return: String
options.win32Ext
Type: string
Default: .exe
A file extension that will be appended to the string on Windows.
// On Windows
toExecutableName('foo'); //=> 'foo.exe'
toExecutableName('foo', {win32Ext: '.bat'}); //=> 'foo.bat'
License
ISC License © 2017 Shinnosuke Watanabe