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.
- Host: GitHub
- URL: https://github.com/fiahfy/electron-accelerator-formatter
- Owner: fiahfy
- License: mit
- Created: 2018-09-06T06:52:00.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:59:43.000Z (over 3 years ago)
- Last Synced: 2025-10-06T13:38:22.450Z (9 months ago)
- Topics: accelerator, electron, formatter
- Language: TypeScript
- Homepage:
- Size: 1.22 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# electron-accelerator-formatter

> 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.