to-executable-name

Append .exe to a given string if the program is running on a Windows environment


Keywords
append, name, filaname, environment, windows, exe, bin, executable, string
License
ISC
Install
npm install to-executable-name@2.0.0

Documentation

to-executable-name

npm version Build Status Build status Coverage Status

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

Use npm.

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