Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/to-executable-name
Append .exe to a given string if the program is running on a Windows environment
https://github.com/shinnn/to-executable-name
Last synced: 27 days ago
JSON representation
Append .exe to a given string if the program is running on a Windows environment
- Host: GitHub
- URL: https://github.com/shinnn/to-executable-name
- Owner: shinnn
- License: isc
- Created: 2015-05-03T12:53:58.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-01-11T22:27:33.000Z (almost 6 years ago)
- Last Synced: 2024-10-06T13:49:01.577Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://npm.runkit.com/to-executable-name
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# to-executable-name
[![npm version](https://img.shields.io/npm/v/to-executable-name.svg)](https://www.npmjs.com/package/to-executable-name)
[![Build Status](https://travis-ci.com/shinnn/to-executable-name.svg?branch=master)](https://travis-ci.com/shinnn/to-executable-name)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/to-executable-name.svg)](https://coveralls.io/github/shinnn/to-executable-name)Append `.exe` to a given string if the program is running on a [Windows](https://www.microsoft.com/windows) environment
```javascript
const toExecutableName = require('to-executable-name');// On Windows
toExecutableName('node'); //=> 'node.exe'// Otherwise
toExecutableName('node'); //=> 'node'
```## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install to-executable-name
```## API
```javascript
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.
```javascript
// On WindowstoExecutableName('foo'); //=> 'foo.exe'
toExecutableName('foo', {win32Ext: '.bat'}); //=> 'foo.bat'
```## License
[ISC License](./LICENSE) © 2017 - 2019 Shinnosuke Watanabe