An open API service indexing awesome lists of open source software.

https://github.com/fiahfy/electron-accelerator-formatter

Format electron accelerators according to the platform.
https://github.com/fiahfy/electron-accelerator-formatter

accelerator electron formatter

Last synced: 2 months ago
JSON representation

Format electron accelerators according to the platform.

Awesome Lists containing this project

README

          

# electron-accelerator-formatter

![badge](https://github.com/fiahfy/electron-accelerator-formatter/workflows/Node.js%20Package/badge.svg)

> Format [electron accelerator](https://electronjs.org/docs/api/accelerator) according to the platform.

## Installation

```bash
npm install @fiahfy/electron-accelerator-formatter
```

## Usage

```js
import { format } from '@fiahfy/electron-accelerator-formatter'

console.log(format('CmdOrCtrl+A')) // got '⌘A' on darwin, 'Ctrl+A' on win32
```

## API

### format(accelerator)

Return the accelerator formatted text according to the current platform.

#### accelerator

Type: `string`

The accelerator provided from electron.