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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    2
    • latest

Version History

Package Sidebar

Install

npm i to-executable-name

Weekly Downloads

6

Version

2.0.0

License

ISC

Last publish

Collaborators

  • shinnn