Socket
Book a DemoInstallSign in
Socket

electron-accelerator-formatter

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-accelerator-formatter

Formats an Electron accelerator as a string of Unicode characters.

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

electron-accelerator-formatter

Formats an accelerator as a string of Unicode characters.

Handles Windows and Mac, not yet Linux.

Works in both Electron (i.e. Node) and the browser!

Installation

For Electron:

npm install electron-accelerator-formatter --save

For the browser:

bower install electron-accelerator-formatter --save

Usage

In Electron:

var acceleratorFormatter = require('electron-accelerator-formatter');

var accelerator = 'CmdOrCtrl+Shift+M';

// Prints '⌘⇧M' on Mac, '^⇧M' on Windows
console.log(acceleratorFormatter(accelerator));

In the browser:

<!-- Loads `electronAcceleratorFormatter` into `window`. -->
<script src="bower_components/electron-accelerator-formatter/dist/bundle.min.js"></script>

<script type="text/javascript">
  var accelerator = 'CmdOrCtrl+Shift+M';

  // Prints '⌘⇧M' on Mac, '^⇧M' on Windows
  console.log(electronAcceleratorFormatter(accelerator));
</script>

Contributing

We welcome pull requests! Please lint your code.

Running tests

To run the Node tests: npm test.

To run the browser tests: npm run-script build-test && npm run-script open-test.

Building for release

npm run-script build

Release History

  • 1.1.1 Add bower.json file
  • 1.1.0 Works in the browser!
  • 1.0.1 Documentation fix
  • 1.0.0 Initial release.

Keywords

electron

FAQs

Package last updated on 15 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts