npm

Join us for the upcoming webinar, "Enterprise JavaScript done right: the tools you love, the security you need."Sign up here »

to-executable-name

2.0.0 • Public • Published

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

install

npm i to-executable-name

Downloadsweekly downloads

48

version

2.0.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability